File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Redrawing a JComboBox

 
Rik Sweeney
Ranch Hand
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a JComboBox whose values change dynamically. This all works OK except that the size of the box doesn't change. If I resize the browser window then the applet refreshes itself and the box resizes itself too.

This problem only appears to happen in the applet so was wondering if anyone can suggest how to make the box resize itself automatically. Here is the code that I'm using:



Thanks

Richard>
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could call the Applet's invalidate method to notify it that the layout is no longer valid, and that it should repaint itself.
 
Rik Sweeney
Ranch Hand
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the suggestion, I'll give it a try!

Richard
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic