Results 1 to 2 of 2
  1. #1
    patriotsfan is offline Member
    Join Date
    May 2011
    Posts
    38
    Rep Power
    0

    Default Need Help with displaying JFrame through an html file using an applet

    I made a program using netbeans swing/matisse to build a GUI and I want to know if its possible to use an applet to open that program from an html file. I created a new java applet and it does open the JFrame (Within netbeans) but 2 windows pop up, 1 being the empty applet, and 1 being the JFrame. I want the JFrame to open directly in html file and if possible not show the applet window, any suggestions?

    Here is my code for applet....
    Java Code:
    package EdmondsVet;
    
    import java.applet.*;
    import javax.swing.JApplet;
    import javax.swing.JFrame;
    	 
    	public class Applet1 extends JApplet
    	 
    	{
    	    VetGUI newFrame;
    	    public void init()
    	    {
    	        newFrame = new VetGUI();
    	        newFrame.setSize(550,550);
    	        newFrame.setVisible(true);
    	    }
    	     
    	}
    I also have some html code but it does not work......

    XML Code:
    <html>
    <body>
    <applet code = "Applet1.class" width="400" height="100">
    </applet>
    <body>
    </html>

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

    Default Re: Need Help with displaying JFrame through an html file using an applet

    No, if you create an applet it displays an applet. If you're smart, your GUI will be geared to create a JPanel since that way if you desire you can display it in a JFrame for a stand-alone app or in a JApplet for applet type application.

Similar Threads

  1. Components not displaying on JFrame
    By mDennis10 in forum New To Java
    Replies: 5
    Last Post: 07-27-2011, 07:48 PM
  2. Displaying HashMap in a JFrame
    By ankit1801 in forum New To Java
    Replies: 1
    Last Post: 05-19-2011, 07:54 AM
  3. Opening applet with .html file
    By Atriamax in forum New To Java
    Replies: 12
    Last Post: 09-13-2009, 06:26 AM
  4. Replies: 0
    Last Post: 03-10-2008, 02:36 PM
  5. init() method displaying html
    By reddzer in forum Java Servlet
    Replies: 0
    Last Post: 11-10-2007, 07:20 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
  •