JButton <- J("javax.swing.JButton")
button <- new(JButton,"Coeffient test")
addComponent(dialog,button,780,980,870,640)
subDialog <- new(SimpleRSubDialog,dialog,"Coeffient test")
ActionListener <- J("org.rosuda.deducer.widgets.event.RActionListener")
actionFunction <- function(cmd,ActionEvent){
nr.indep <- length(indep$getVariables())
if(nr.indep > 0) {
subDialog <- new(SimpleRSubDialog,dialog,"Coeffient test")
size <- nr.indep * 80
if(nr.indep == 1)
size <- size + 50
setSize(subDialog,260,size)
coeft <- new(CheckBoxesWidget,"Coefficient test", .jarray(indep$getVariables())
coeft$setTitle("coeft")
addComponent(subDialog, coeft,10,950,600,50)
subDialog$setLocationRelativeTo(button)
subDialog$run()
}
}
listener <- new(ActionListener)
listener$setFunction(toJava(actionFunction))
button$addActionListener(listener)