File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes Redrawing a JComboBox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Redrawing a JComboBox" Watch "Redrawing a JComboBox" New topic
Author

Redrawing a JComboBox

Rik Sweeney
Ranch Hand

Joined: Sep 04, 2001
Posts: 36
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
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
You could call the Applet's invalidate method to notify it that the layout is no longer valid, and that it should repaint itself.


Ping & DNS - updated with new look and Ping home screen widget
Rik Sweeney
Ranch Hand

Joined: Sep 04, 2001
Posts: 36
Thanks for the suggestion, I'll give it a try!

Richard
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Redrawing a JComboBox
 
Similar Threads
Question about JCombobox
Struts logic:iterate weirdness
any idea about JComboBox Modal? with JDBC
combobox is not updating in Swing GUI
Display value and Actual value in JComboBox