Results 1 to 5 of 5
  1. #1
    verd is offline Member
    Join Date
    Jul 2012
    Posts
    17
    Rep Power
    0

    Default Simple Applet/Frame program.

    I was wondering if it is possible to make a java program both with JFrame or JApplet. So, I wouldn't have to rewrite it. Would putting in main method with the Applet methods work?

  2. #2
    cselic is offline Senior Member
    Join Date
    Apr 2010
    Location
    Belgrade, Serbia
    Posts
    278
    Rep Power
    5

    Default Re: Simple Applet/Frame program.

    Yes it is possible. There are few things that it should be changed (in your "JApplet or JFrame" code) when you're doing that so you could simply convert JFrame to JApplet, and JApplet to JFrame.
    Last edited by cselic; 07-15-2012 at 01:50 AM.

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

    Default Re: Simple Applet/Frame program.

    A better approach (I think) is to gear your GUI towards creating JPanels, and then display them as is best. If you want to display it as an applet, then put it in a JApplet, if as a stand alone, then in a JFrame. You also have the option of displaying it as a dialog, or nested in another component,... etc.

  4. #4
    verd is offline Member
    Join Date
    Jul 2012
    Posts
    17
    Rep Power
    0

    Default Re: Simple Applet/Frame program.

    Thanks, but I got it.

  5. #5
    cselic is offline Senior Member
    Join Date
    Apr 2010
    Location
    Belgrade, Serbia
    Posts
    278
    Rep Power
    5

Similar Threads

  1. eventhandler applet and frame
    By gomorais in forum New To Java
    Replies: 0
    Last Post: 04-20-2011, 10:16 PM
  2. Replies: 3
    Last Post: 08-07-2010, 06:28 AM
  3. destroy an applet inside a frame
    By afraidofdark in forum Advanced Java
    Replies: 1
    Last Post: 03-28-2010, 06:41 PM
  4. frame as an applet
    By shruti in forum Java Applets
    Replies: 0
    Last Post: 07-18-2009, 12:32 PM
  5. Rectangle expands with applet frame
    By Godzilla in forum New To Java
    Replies: 1
    Last Post: 07-10-2007, 08:14 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
  •