I am new to java and having issues.
package components;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
/* FrameDemo.java requires no other files. */
public class ContactApp
{
/**
* Create the GUI and show it. For thread safety,
* this method should be invoked from the
* event-dispatching thread.
*/
private static void createAndShowGUI()
{
//Create and set up the window.
JFrame frame = new JFrame("FrameDemo");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel emptyLabel = new JLabel("");
emptyLabel.setPreferredSize(new Dimension(175, 100));
frame.getContentPane().add(emptyLabel, BorderLayout.CENTER);
//Display the window.
frame.pack();
frame.setVisible(true);
}
public static void main(String[] args)
{
//Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI.
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
createAndShowGUI();
}
});
}
}
I am using this code as an example but when I try to view it all I get is a blank screen. Can someone tell me what to write in my notepad to view the applet. I have this now
<html>
<head>
<title>Dice Game Canvas</title>
</head>
<body>
<h1 align=center>Contact Application</h1>
<center>
<applet name="ContactApp"
code="ContactApp.class"
width=400
height=150>
</applet>
</center>
</body>
</html>
I don't know if this is correct if any one can help. Thank you.