Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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!!!

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

![]() |
![]() |
![]() |

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