• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Possible to use applet from swing app?  RSS feed

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to open and use a java applet from a desktop swing application?
 
Rancher
Posts: 42973
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What would be the point of that? Instead of making it an applet (by extending JApplet), make it a window (by extending JFrame), and you're mostly done.

Or is it someone else's applet that you don't have code for? You can always open a web page that refers to the applet; the last item on this FAQ page tells you how.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can always create the applet yourself and set its AppletContext to a small stub implementation, then call the init() and start() methods. You can also call JApplet.getContentPane() and reinstall that component in a JFrame's content pane, assuming the applet doesn't assume too much about its environment.
 
Ulf Dittmer
Rancher
Posts: 42973
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

You can always create the applet yourself and set its AppletContext to a small stub implementation, then call the init() and start() methods.


The MainFrame class already does most of that, if you want to go down that road.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!