How to change Swing app to JApplet

R

Roedy Green

how to change a Swing app to a JApplet?
what should I change in codes?

It is a lot easier to convert a JApplet to a application or a hybrid
than the reverse. Have a look at some of my hybrids at
http://mindprod.com/products1.html

You move all your code to allocate and set up components to init.

Init also must set up the listeners and do the layout. I use IntelliJ
to refactor the code to put each of these functions in its own method
called by init.

You then need to write your start, stop and destroy, often empty.

Make user you use JApplet.getContentpane rather than using JApplet
directly for setBackground, setLayout and add.

look at one of my programs like
http://mindprod.com/products1.html#AMERICANTAX
to see the overall structure.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,112
Latest member
VinayKumar Nevatia
Top