Results 1 to 8 of 8
  1. #1
    dbashby's Avatar
    dbashby is offline Senior Member
    Join Date
    Mar 2009
    Posts
    223
    Rep Power
    6

    Question convert application to applet in netbeans

    I have managed to locate a tutorial that explains in a way that I understand how to create an applet in netbeans.

    Java Code:
    http://blogs.sun.com/pc/entry/how_to_create_applet_with
    however I cannot find one that enables you to convert a current completed application in netbeans to an applet.

    Can anyone suggest any apart from netbeans.

    Thanks in advance

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Does your netbeans application subclass JFrame? If so, re-write it so that it subclasses JPanel (or better, produces a JPanel). Then you can place this JPanel into a JFrame or a JApplet as you desire.

  3. #3
    dbashby's Avatar
    dbashby is offline Senior Member
    Join Date
    Mar 2009
    Posts
    223
    Rep Power
    6

    Default

    I have to admit you have lost me, my application is structured using a number of classes with a Main and a Jpanel gui.

    Does this answer what you are asking me

    We are not actually being taught java, apparently the methodology is more important, education in the uk is so wonderful!

  4. #4
    emceenugget is offline Senior Member
    Join Date
    Sep 2008
    Posts
    564
    Rep Power
    7

    Default

    i suppose it's a trade off for your class, then. when in class, would you rather learn a specific shortcut to convert a swing app into an applet, or actually learn concepts that will help you organize your thoughts, encourage you to research more, and overall make you a better programmer?

  5. #5
    dbashby's Avatar
    dbashby is offline Senior Member
    Join Date
    Mar 2009
    Posts
    223
    Rep Power
    6

    Default

    I would prefer the having some idea of what we are doing rather than just going through the motions however I am trying to pick up more information regarding Java but this is as well as doing the work required.

  6. #6
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    Have a method that creates the GUI and returns a JPanel. Have your main class subclass JApplet. Then use init() to add the JPanel to getContentPane() and use main() to add the JPanel to a new JFrame.

    Bingo - an applet and an application
    Last edited by OrangeDog; 04-18-2009 at 04:22 AM.
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

  7. #7
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Yep, I agree 100% with OrangeDog. Creating your GUI this way will give you loads of flexibility. Shoot you can even place your GUI into the JPanel of another GUI if you so desire.

  8. #8
    dbashby's Avatar
    dbashby is offline Senior Member
    Join Date
    Mar 2009
    Posts
    223
    Rep Power
    6

Similar Threads

  1. Replies: 1
    Last Post: 03-27-2009, 06:47 PM
  2. Convert to Applet
    By Urgle in forum New To Java
    Replies: 1
    Last Post: 11-12-2008, 02:15 PM
  3. Convert the application from 9i to 10g
    By rahul999 in forum JDBC
    Replies: 5
    Last Post: 09-03-2008, 04:55 PM
  4. How to convert batch application to server app?
    By johann_p in forum New To Java
    Replies: 0
    Last Post: 03-28-2008, 10:39 PM
  5. Convert a program to Applet
    By carl in forum Java Applets
    Replies: 2
    Last Post: 08-09-2007, 10:33 PM

Posting Permissions

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