• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTabbedPane selected tab color  RSS feed

 
Raja Kannappan
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • 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.
 
Gary Hodge
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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 ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!