Content deleted Content added
m Signing comment by Ncmathsadist - "→Messy Code: " |
Ncmathsadist (talk | contribs) →Hello World doesn't run?: INserted working HelloWorld |
||
Line 56:
}
}
Cleaned up Hello World
import javax.swing.JFrame;
import javax.swing.JLabel;
public class HelloWorld implements Runnable
{
public void run()
{
JFrame f = new JFrame ("Hello, World!");
f.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
f.getContentPane().add (new JLabel("Hello, World!"));
f.pack();
f.setVisible(true);
}
public static void main(String[] args)
{
HelloWorld hw = new HelloWorld();
javax.swing.SwingUtilities.invokeLater (hw);
}
}
=== Cryptic example ===
|