• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

cahnging color of Divider

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can I change the Color of the divider in a JSplitPane?
Thanks,
Neeraj
 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot, It worked!!!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic