sure, any dialog extending RDialog has a method getOkayCanel(), which
returns the OkayCancel buttons at the bottom. you can then get the OK
button with getApproveButton(). You can see what methods are available
with .jmethods(subDialog).
#make dialog
subDialog <- new(SimpleRSubDialog,.jnull(),"sub dialog")
setSize(subDialog,250,300)
#make action listener
ActionListener <- J("org.rosuda.deducer.widgets.event.RActionListener")
actionFunction <- function(cmd,ActionEvent){
cat("hi there")
}
listener <- new(ActionListener)
listener$setFunction(toJava(actionFunction))
#get button and add action listener
okButton <- subDialog$getOkayCancel()$getApproveButton()
okButton$addActionListener(listener)
subDialog$setVisible(T)