Computing.Net > Forums > Programming > Java Swing/Re-Paint Problem

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Java Swing/Re-Paint Problem

Reply to Message Icon

Name: SmittyZ3M
Date: April 15, 2005 at 08:21:04 Pacific
OS: Win XP
CPU/Ram: 1.6 GHz/512 MB
Comment:

I am in the process of converting a Java application to a JApplet. The JApplet contains Swing components, and it paints/draws objects as well. The Swing component types in the JApplet are JLists, JButtons, JTextFields, and JLabels.

The problems are as follows. First, when the applet loads in a browser or in appletviewer, 9 times out of 10 all the swing components do not show up. I either have to refresh the web page about 5 times, or I have to maximize, then minimize the appletviewer window. Once they all appear, everything is well until I decide to resize the window, move the window, move the scroll bar in the browser window, etc. In other words, it seems to me as if when the applet is repainted, the Swing stuff disappears.

I am using Java 1.5 on a Windows PC. I also tried compiling it on Java 1.4 on a Solaris System, and the problems continue. When the paint() method is called, the components that I actually manually paint onto the applet are fine, its just the Swing stuff.

For debugging purposes, I added an AWT Button, and an AWT Label to see if they had the same problem. Guess what? They don't! The AWT stuff works perfectly fine.

Any help is highly appreciated!!!



Sponsored Link
Ads by Google

Response Number 1
Name: anonproxy
Date: April 17, 2005 at 14:45:44 Pacific
Reply:
0

Response Number 2
Name: SmittyZ3M
Date: April 18, 2005 at 13:20:44 Pacific
Reply:

Yes, I did some searching after I made my first post and found what my problem was. Thanks for the response.


0

Response Number 3
Name: Maoz
Date: May 5, 2005 at 14:08:21 Pacific
Reply:

Hi
How did you solve it?
I'm having the same problem!
Thanks
Maoz


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Java Swing/Re-Paint Problem

Java, Swing, JTables www.computing.net/answers/programming/java-swing-jtables/133.html

Java Swing Interface www.computing.net/answers/programming/java-swing-interface-/9092.html

file manipulation problems in java www.computing.net/answers/programming/file-manipulation-problems-in-java/12669.html