Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8101449

setOnAction() should be available on CheckBox, ToggleButton... All ButtonBase?

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • fx2.0
    • fx2.0
    • javafx
    • win7 build32 32 bits

      When I discovered the different API for manipulating different controls, I was quite surprised.
      Using the auto completion in NB, I expected to find a setOnAction() method on each "ButtonBase" controls such as Button.

      I now understand that, in some case we have to use the setOnAction() (Button or HyperLink) and have to use the selectedProperty for others.
      For the JavaFX adoption, I would like to have more common strategy for most of controls.
      Moreover, when I design a new GUI, I often use Buttons, and sometimes I switch the controls to CheckBox etc..., and in that case it no more compiles.

      Maybe I missed a "core design" of the JFX Controls, but from a beginner perspective, I think my point makes sense.

      Thanks for your attention!

            kwwong Kinsley Wong (Inactive)
            anouardjfx arnaud nouard (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: