Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problems with repaint

Status
Not open for further replies.

john829

Programmer
Sep 14, 1999
10
US
I am trying to help someone fix her code. She has a stand alone java app that when it opens, is a blank 500,500 pane. When you select a menu item, the appropriate information is supposed to appear. The only problem is it won't appear unless you grab an edge and resize the app first. I have tried calling paint, repaint, update and even tried to manually resize the pane, but nothing works. It is a swing app. The basics of how it works are when a menu item is selected, the actionlistener creates a new pane and adds it to the contentpane. Anyone have any ideas?
 
I had a problem similar to this in an Applet I wrote. My problem was that the JTable in my panel wouldn't resize correctly when the window size changed, until I resized the window again.

Anyway, try calling updateUI, on the panel in the frame. You might also look at invalidate(), validate(), and revalidate().

Hope one of those works.

-jw
 
The swing that's packaged with JDK1.4 has had some of the repaint bugs fixed. If nothing else works, try running it under that. If you don't want to install the entire JDK, just download and use the JRE to run your code after compiling on your existing JDK.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top