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

Disable/enable tabs in a TabPane

XMLWordPrintable

      I have a tab pane with 5 tabs in it. I would like to be able to programmatically stop some of them from activating. So when a user clicks on a disabled tab nothing happens (the normal behavior of switching to that tab happens on an enabled tab).

      At it's simplest what I want is to treat the tab header as a button that I can disable/enable like other buttons.

      Another approach would be to have an event for activating a new tab, as then I could catch and consume that event in certain circumstances (much like you can catch and consume other events to stop them bubbling up). The point here is that my condition for disabling a tab can be quite complex, something that may not fit into a simple disable/enable scenario. Of course this has it's downside too in that a disabled tab could have a different look, just like a disabled button.

      So perhaps both :-)

        1. RT17668.diff
          33 kB
        2. TabPane.avi
          1.76 MB

            kwwong Kinsley Wong (Inactive)
            gmatthewsjfx Graham Matthews (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: