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.

What if the divider lines of your ListView look like this? You wonder why when you clearly specified in your XML that the divider height should only be 1px. So why is it thick in alternating rows?

I am not saying this is the only solution but there is a big chance that this is the one. Check your AndroidManifest.xml and see if you have set a minimum and maximum version SDK required. If not, then add it. The divider height for your ListView will all be 1px.

Check the code below.

On a side note, this is also the solution for rating stars that are not displayed in crisp detail instead showing you blurred edges.

As per version 1.6 of the JDK, there is no MetalSplitPaneDivider class in the API although if you set the JSplitPane‘s UI to use the MetalSplitPaneUI class, it will set the divider’s look and feel to metal. You may want to get access to the divider object like the left and right buttons and by using the BasicSplitPaneDivider class, the divider will not have a metal look and feel.

Luckily, while surfing through the web, I came across the work of Steve Wilson, Tom Santos and Ralph Kar who created two classes: MetalBumps and MetalSplitPaneDivider: so you could have access to the divider object and have a metal look and feel.

MetalBumps.java

MetalSplitPaneDivider.java

Related Posts Plugin for WordPress, Blogger...