jQuery in Action, 3rd edition
The moose likes Swing / AWT / SWT and the fly likes How to change color of SplitPane? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to change color of SplitPane?" Watch "How to change color of SplitPane?" New topic

How to change color of SplitPane?

Matt Wil

Joined: Apr 05, 2004
Posts: 23
I am trying to change the color of my java applet.. I am able to change everything except the color of the divider bar in my SplitPane. I read about using this inside the splitpane:


This only changes a thin line at the very top of the divider bar to red. How do I change the entire divider bar to a color?

I have already tried this with the same results as above:


Jeffrey Bennett

Joined: May 17, 2004
Posts: 12
I have a custom splitpane widget tricked out for n-way splits, and needed to juice the divider (color, extra widgets, etc.) Some of this may help.

You need to setBackground on both the JSplitPane, as well as the divider. In my extension of JSplitPane, I just overrode setBackground(...) to invoke super, then get the divider (as you wrote) and do a divider.setBackground(...)

I also seem to have extended BasicSplitPaneDivider such that setBackground(...) on this would get applied to the leftButton and rightButton too.
I agree. Here's the link: http://aspose.com/file-tools
subject: How to change color of SplitPane?
It's not a secret anymore!