Two Laptop Bag*
The moose likes Swing / AWT / SWT and the fly likes cahnging color of Divider Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "cahnging color of Divider" Watch "cahnging color of Divider" New topic
Author

cahnging color of Divider

Jain Neeraj
Ranch Hand

Joined: Aug 09, 2001
Posts: 35
How can I change the Color of the divider in a JSplitPane?
Thanks,
Neeraj
Rene Liebmann
Ranch Hand

Joined: May 02, 2002
Posts: 196
Hello Neeraj,
it depends on what kind of LAF you use. If you use the Java LAF, then it is easy. For this LAF, you can create themes. A theme consists of 6 colors and 6 fonts.
So you could write your own theme or you extend from the DefaultTheme and you can overwrite the color, which ontains the color for the divider.
The only problem is, you will change lots of other component colors too.
Another idea would be to go directly over JSplitPane.getUI(), which returns u a SplitPaneUI, which you probably can cast to a BasicSplitPaneUI. There you will find a function getDivider() and this is a Component, where you can set any Color.
Hope that helps

Rene
Jain Neeraj
Ranch Hand

Joined: Aug 09, 2001
Posts: 35
Thanks a lot, It worked!!!
 
 
subject: cahnging color of Divider
 
Similar Threads
how to remove ListView Activity Lines in Android
JSplitPane Divider
trouble displaying ImageIcon
How to change color of SplitPane?
changing link color for just one part of a page