Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What to draw on?

 
Liz Hundy
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I want to make a dynamic picture in my application.

So I made a subclass of Canvas and made a very nice drawing.

But now I find that my JComboBox insists on opening behind the canvas.

So what should I do to make a drawing that goes behind the drop-down of a JComboBox?

---Liz
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JPanel.
 
Liz Hundy
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.

That works a treat.

---Liz
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Matti Poro
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or JComponent. Canvas is a heavy-weight (AWT) component and the classes which start with J are light-weight components (Swing). You shouldn't usually mix AWT and Swing in your program because it can cause problems like the one you experienced.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Swing/AWT forum...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic