• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTabbedPanes see-through ImageIcons

 
James Redpath
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JTabbedPane with three tabs. The First and Third tabs have an ImageIcon (each different instance). When the Frame (DialogFrame) first comes up the ImageIcon in Tab 3 shows through on top of Tab 1. Now when you select the Tabs 3 and then 1 the ImageIcon is then fixed and not seen-through to the first tab. How to fix? I don't want to see the Tab 3 ImageIocn in Tab 1. For testing I have tried using the same ImageIcon instance in Tab 1 also in Tab 3 and it still does the same behavior.
[ August 17, 2003: Message edited by: James Redpath ]
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the code relevant to setting up the JTabbedPane and the icons? I'm not sure what you mean by "showing through"... Maybe redraw problems? Or maybe mixing heavy and lightweight components?
 
James Redpath
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found it I was using a Canvas and drawing the ImageIcon. Instead I used a JLabel with ImageIcon and it fixed it. This made it less complicated as well. I forgot that SWING now provides ImageIcon use with a label.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by James Redpath:
I found it I was using a Canvas and drawing the ImageIcon. Instead I used a JLabel with ImageIcon and it fixed it. This made it less complicated as well. I forgot that SWING now provides ImageIcon use with a label.

"Now provides.."?? When did they not provide that? Well, I guess I have only been using SWING since jdk1.3 though.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!