• Post Reply Bookmark Topic Watch Topic
  • New Topic

Launch JFrame from JApplet

 
Josh Britton
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have read that when initializing and showing a Swing window, I should do so in a Runnable to keep from messing up Swing's thread-unsafe Event-Queue. I don't fully understand all that, but I do it anyway. Is the same true for when launching a JFrame from within a JApplet?

In other words, when I set the JFrame visible inside my Applet code, do I need to do so in a new Thread?

Thanks!

josh
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Josh,
Welcome to the Ranch. We are happy to have you here

Since JApplet and JFrame are both "swing" components, the answer is yes.
The usual way to do it is SwingUtilities#invokeLater(Runnable runnable), but you know about that part already
 
Josh Britton
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Maneesh.

josh
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!