Results 1 to 3 of 3
  1. #1
    xSkittlesx is offline Member
    Join Date
    May 2010
    Rep Power

    Question Changing an Applet to a JPanel

    Hi.. i made an applet but i want to put it into a JPanel container.

    any1 can help me? wer do i start?? sorry,im noob with java..

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Eastern Florida
    Rep Power


    Why? What are you going to do with the JPanel?
    See the API doc for JPanel to see how to "add" components to it.

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Blog Entries
    Rep Power


    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).

Similar Threads

  1. Changing default Applet Viewer Size?
    By in forum Java Applets
    Replies: 6
    Last Post: 08-27-2010, 07:42 PM
  2. Replies: 3
    Last Post: 02-06-2010, 04:28 PM
  3. display a new jpanel in an applet
    By toymachiner62 in forum Java Applets
    Replies: 6
    Last Post: 10-19-2009, 12:10 AM
  4. Changing JPanel sizes
    By Basit in forum Java Applets
    Replies: 2
    Last Post: 08-12-2009, 07:48 PM
  5. how to draw x-y graph in Jpanel.--not in APPLET.
    By in forum New To Java
    Replies: 2
    Last Post: 08-24-2008, 06:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts