Swing freeze

I have developed a free software under the MS Flight Simulator (FS). It runs during the flight and records information about that. It will work fine as you can see on these pictures below:

http://members.chello.hu/havasi.balazs/normal.JPG

This is when i want to close the application (works normally):

http://members.chello.hu/havasi.balazs/normalexit.JPG

Of course sometimes it is necessary to switch from FS to that logger with alt+tab. It works fine.

But when I switch on the Anti Aliasing or Antisotrop Filtering, the whole application freezes when i switch from FS with an alt+tab:

http://members.chello.hu/havasi.balazs/freeze.JPG

The program refreshes fine until I switch to FS.

The program doesn't crash because if i would like to close the program, it will ask that question, but I see nothing:

http://members.chello.hu/havasi.balazs/freezeexit.JPG

It reacts the keyboard events correctly. If i press tab and then space at this question the program exits. I tried to refresh (revalidate, repaint, paintall, paintcomponents) but no results. If I start a Thread which repaints it every seconds then sometimes I can see the GUI but i can't enter any data.

Does anyone have a hint?

Thanks for advance.

[1287 byte] By [Hefia] at [2007-11-27 6:54:37]
# 1
can you post some code?
fastmikea at 2007-7-12 18:29:41 > top of Java-index,Desktop,Core GUI APIs...
# 2
I will be near Java tomorrow. But you can reproduce it by a simple Swing application which uses e.g. JFrame, JTabbedPane, JButton.I've tried with a simple AWT window but in that case there were no freezes.
Hefia at 2007-7-12 18:29:41 > top of Java-index,Desktop,Core GUI APIs...
# 3
One more comment...It is possible that you can only reproduce this error on NVidia display cards. The reports came from users who have NVidia cards. I don't know how it works on ATI or other cards.
Hefia at 2007-7-12 18:29:41 > top of Java-index,Desktop,Core GUI APIs...
# 4

Here is the code. Nothing special :)

public class Test {

public JFrame f;

private Container content;

public void init(){

f=new JFrame();

f.setTitle("TEST");

content=f.getContentPane();

content.setLayout(new BoxLayout(content,BoxLayout.Y_AXIS));

content.add(new JLabel("This is a text message"));

content.add(new JButton("TEST"));

content.add(new JTextField());

f.pack();

f.setVisible(true);

//new refr(this).start();

}

public static void main(String[] args) {

Test t=new Test();

t.init();

}

}

Hefia at 2007-7-12 18:29:41 > top of Java-index,Desktop,Core GUI APIs...
# 5

Point 1) When posting code, please use code tags. You can find out about them [url=http://forum.java.sun.com/help.jspa?sec=formatting]here[/url].

Point 2) Does your posted code reproduce your problem? I ran your code, and except for displaying a test JFrame with a textbox, message, and button, it does nothing. If it does reproduce your problem, how and when does it occur? If not, why post this code?

Good luck

/Pete

ps: is your mini-app supposed to freeze after "alt-tabs"? Mine doesn't.

Message was edited by:

petes1234

petes1234a at 2007-7-12 18:29:42 > top of Java-index,Desktop,Core GUI APIs...
# 6

Point 1) Sorry for the code formatting. I was in hurry :(

Point 2) I could reproduce it after an alt+tab with Flight Simulator.

- maybe it is the bug of the simulator.

- maybe it is an NVidia bug.

I don't know it can be reproducable with other programs. It can be good if you have this one :).

Hefia at 2007-7-12 18:29:42 > top of Java-index,Desktop,Core GUI APIs...
# 7

> Point 1) Sorry for the code formatting. I was in

> hurry :(

> Point 2) I could reproduce it after an alt+tab with

> Flight Simulator.

> - maybe it is the bug of the simulator.

> - maybe it is an NVidia bug.

> I don't know it can be reproducable with other

> programs. It can be good if you have this one :).

sorry, I didn't read initial post carefully enough. I have neither an NVidia card nor the Flight Simulator, and so I'll bow out. Good luck!

/Pete

petes1234a at 2007-7-12 18:29:42 > top of Java-index,Desktop,Core GUI APIs...
# 8

change the following:

public static void main(String[] args) {

Test t=new Test();

t.init();

}

to...

public static void main(String[] args) {

Runnable r = Runnable() {

public void run() {

Test t=new Test();

t.init();

}

};

EventQueue.invokeLater(r);

}

jvaudrya at 2007-7-12 18:29:42 > top of Java-index,Desktop,Core GUI APIs...
# 9

It doesn't work :(

But...

I made a new Tread which calls the JFrame's paintAll method in every second. Of course I see nothing after the alt tab. But when i move my mouse over the application's icon on the tray and the tooltip is displayed I can see the JFrame window, and i can enter characters. But as soon as I move the mouse away from the tray, the JFrame freezes again. I have the same situation when I click the application with the right mouse button:

http://members.chello.hu/havasi.balazs/interesting.JPG

From this point I think it is not the Java fault. But if someone still has an idea please post here.

Is there a way to set the JVM Graphical engine (e.g. software or hardware rendering or something like this)?

Message was edited by:

Hefi

Hefia at 2007-7-12 18:29:42 > top of Java-index,Desktop,Core GUI APIs...