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

How to show this JComboBox?

 
arun mahajan
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I was wondering why this JComboBox is not showingup, though if i try to use Choice it works with the same code.
Can you help me?
regards,
arun
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instead of calling repaint(), you need to call


repaint just paints the component, validate sets up all the component's children. Since you are adding new components, validate needs to be called instead of repaint.

-Nate
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic