Results 1 to 3 of 3
Thread: Changing an Applet to a JPanel
- 05-31-2010, 09:21 AM #1Member
- Join Date
- May 2010
- Rep Power
- 05-31-2010, 03:30 PM #2
Why? What are you going to do with the JPanel?
See the API doc for JPanel to see how to "add" components to it.
JApplets have contentPanes which I believe are usually JPanels (though they could be set to be any object derived from Container). So one way to derive a JPanel from a JApplet is to call getContentPane() on the JApplet object. Having said this, I'm not recommending that you do this, but rather you probably should re-write the app to create a JPanel from the beginning. Then if you want to place this JPanel in a JApplet or JFrame (or JDialog), you do so easily by calling getContentPane().add(myJPanel).
- By email@example.com in forum Java AppletsReplies: 6Last Post: 08-27-2010, 06:42 PM
- By david.stefka in forum AWT / SwingReplies: 3Last Post: 02-06-2010, 04:28 PM
- By toymachiner62 in forum Java AppletsReplies: 6Last Post: 10-18-2009, 11:10 PM
- By Basit in forum Java AppletsReplies: 2Last Post: 08-12-2009, 06:48 PM
- By firstname.lastname@example.org in forum New To JavaReplies: 2Last Post: 08-24-2008, 05:01 AM