How To Enable/Disable Buttons Of JSplitPane

I thought that calling setEnabled() on a JSplitPane object will also enable/disable the divider buttons. I found out it does not. Only the divider gets disabled so when you click on the buttons, the JSplitPane will still be resized.

To get a reference on the buttons, you make use of the BasicSplitPaneUI class, cast it and call setEnabled() on them.

Check the code below.

That should let you enable or disable the buttons of the JSplitPane divider.

Related Posts Plugin for WordPress, Blogger...