Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cahnging color of Divider

 
Jain Neeraj
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I change the Color of the divider in a JSplitPane?
Thanks,
Neeraj
 
Rene Liebmann
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot, It worked!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic