Swing (Java): Difference between revisions

Content deleted Content added
Exoad (talk | contribs)
m fix bad code examples for swing especially by putting everything in a run() instead of a init constructor
Exoad (talk | contribs)
m fix JFrame initialization ___location
Line 137:
public class SwingExample implements Runnable {
private JFrame f;
 
public SwingExample() {
// Create the window
JFrame f = new JFrame("Hello, World!");
// Sets the behavior for when the window is closed
f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);