The Swing Version Of The Hello,World ! Program - Java Swing

Java examples for Swing:Introduction

Description

The Swing Version Of The Hello,World ! Program

Demo Code

import javax.swing.*;

public class HelloFrame extends JFrame
{
  public static void main(String[] args)
  {/* w  w  w.  j  a v  a2s  .  c  o  m*/
    new HelloFrame();
  }

  public HelloFrame()
  {
    this.setSize(200,100);
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    this.setTitle("Hello, World!");
    this.setVisible(true);
  }
}

Related Tutorials