problem - no components after switching apps

Hi!

I've got some problem with my swing app. Bsicly it all works good by the time I switch another application so that it covers my swing app. then when I try to switch it back it shows only a blank window without anything on it. Moreover I get 100% cpu usage by java platform.

My app looks moreless like this:

I've got main() in whisz i create a JFrame, on which I later put some button, text fields and two objects extending JComponent on which I paint some stuff using paintComponent() method.

This is first time I'm using JComponent for painting and I guess this might be a problem.

Anybody has any idea?

[650 byte] By [st4chua] at [2007-10-3 8:30:44]
# 1

> Anybody has any idea?

You have a loop somewhere in your program so the GUI never get a chance to repaint itself.

> This is first time I'm using JComponent for painting and I guess this might be a problem.

Here is a simple example that works:

http://forum.java.sun.com/thread.jspa?forumID=57&threadID=594537

camickra at 2007-7-15 3:37:46 > top of Java-index,Desktop,Core GUI APIs...