Google 網路論壇不再支援新的 Usenet 貼文或訂閱項目,但過往內容仍可供查看。

Problem with Swing

瀏覽次數:0 次
跳到第一則未讀訊息

Markus Clermont

未讀,
1998年2月13日 凌晨3:00:001998/2/13
收件者:

Hi!

A strange problem occured, when I tried my GUI, develloped with JDK1.1.4
and Swing 0.7:
I'm using an applet, that does nothing but creating an instance of
JFrame in its init- method. So far everything
is alright:
The JFrame, and all of its components appear on the screen and no
exception is thrown. But immediatly after
the init- method of the applet terminates (or sometimes during the init-
method- this may vary!) this exception is
thrown:

sun.applet.AppletSecurityException: checkawteventqueueaccess
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.lang.RuntimeException.<init>(Compiled Code)
at java.lang.SecurityException.<init>(Compiled Code)
at sun.applet.AppletSecurityException.<init>(Compiled Code)
at sun.applet.AppletSecurity.checkAwtEventQueueAccess(Compiled
Code)
at java.awt.Toolkit.getSystemEventQueue(Compiled Code)
at com.sun.java.swing.Timer.post(Compiled Code)
at com.sun.java.swing.TimerQueue.postExpiredTimers(Compiled
Code)
at com.sun.java.swing.TimerQueue.run(Compiled Code)
at java.lang.Thread.run(Compiled Code)

and no paint- events are posted any more! That means i.e you click on a
radio button, but nothing changes on the screen.
When you maximize and minimize the window, change its size or force the
system in any other way to repaint it,
the changes are made. Despite of the non- painting, the selection-
changed event is punctually posted!

I guess, Swing starts an own thread to do the painting, and this thread
raises the exception and terminates!

The problem occurs with the Java Activator, Applet- Viewer, Netscape
4.04 and the Microsoft IE4.01 (with and without activator!)

I would be very pleased, if anybody helps me!

Greetings, Markus!


Jaideep Baphna

未讀,
1998年2月13日 凌晨3:00:001998/2/13
收件者:Markus Clermont

This happens if the container for any Swing component is not visible. Use a
JApplet instead of Applet and use setVisible(true) for the container(parent)
of your JFrame

Check the Bug parade for a better explanation by serching for
"checkawteventqueueaccess"

Hope that helps
Jaideep

Jaideep Baphna

未讀,
1998年2月13日 凌晨3:00:001998/2/13
收件者:Markus Clermont

Jaideep Baphna

未讀,
1998年2月13日 凌晨3:00:001998/2/13
收件者:Markus Clermont
0 則新訊息