• 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

JTabbedPane selected tab color

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm having problem with tab color of the selected tab. Everything appears fine but there is a yellow line above the text of the selected tab. I'm not setting any color. I tried setting every UIManager property related to TabbedPane but that didn't help. Here is what I tried:

JTabbedPane tabbedPane;

UIManager.put("TabbedPane.selected", Color.GRAY);
UIManager.put("TabbedPane.highlight", Color.GRAY);
UIManager.put("TabbedPane.focus", Color.GRAY);
UIManager.put("TabbedPane.selectHighlight", Color.GRAY);
UIManager.put("TabbedPane.background", Color.GRAY);
UIManager.put("TabbedPane.background", Color.GRAY);
UIManager.put("TabbedPane.foreground", Color.GRAY);
UIManager.put("TabbedPane.lightHighlight", Color.GRAY);
UIManager.put("TabbedPane.shadow", Color.GRAY);
UIManager.put("TabbedPane.darkShadow", Color.GRAY);

tabbedPane = new JTabbedPane();

This still doesn't remove the yellow line at the top of the text of the selected tab. I'm using JDK 1.4.2 and Windows XP with SP 2. Does anyone have any ideas?

Thanks,

- Raja.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what you are seeing is the Windows XP style look and feel. in 1.4.2 this is the default L&F for Windows. prior to 1.4.2 the default L&F was the Windows Classic style. it is set with a line of code like this:

UIManager.setLookAndFeel UIManager.getSystemLookAndFeelClassName());

this should be the first line of code run by your app.

actually, i prefer this L&F because it matches the L&F other Windows apps on XP. also notice that when you mouse over a menu on the menubar (if you have one) that the menu choice is hi-lighted in dark blue. with the Windows Classic L&F, the mouse over causes a shadow underline and right side vertical line.

drove me crazy to, until i changed to the 1.4.2 JRE
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gary, I am not so sure that is what is causing the problem. Just because he is running the app on Windows XP doesn't mean he is using the Windows L&F. The default look and feel for 1.4.x is Metal.

Raja, with that being said, are specifying a look and feel?
 
Raja Kannappan
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. I'm using Windows Look and Feel. As Gary said, if I switch to windows classic theme, I don't see those yellow lines.

That said, is there any way to remove those yellow lines while using windows xp theme?

Thanks for your help guys,

- Raja.
[ May 20, 2005: Message edited by: Raja Kannappan ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic