Embed java applet in JFrame
I'm trying to view a java applet on a web page, inside a JFrame.
Here is what I have so far:
Code:
import java.net.URL;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextPane;
public class Test {
public static void main(String[] args) throws Exception {
JFrame frame = new JFrame("Title");
JPanel panel = new JPanel();
panel.setLayout(null);
JTextPane jtp = new JTextPane();
jtp.setSize(700, 700);
jtp.setLocation(0, 0);
jtp.setContentType("text/html");
jtp.setPage(new URL("http"));
panel.add(jtp);
frame.add(panel);
frame.setLocation(0, 0);
frame.setSize(700, 700);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}
What do I need to do, to make it work?