Perpetual Java Program....

Status
You're currently viewing only LlamaCebu's posts. Click here to go back to viewing the entire thread.
Not open for further replies.

LlamaCebu

Smack-Fu Master, in training
84
code:<HR>
Code:
HelloArsJFrame.java<P>
//Hello Ars?
//I'm too lazy to come up with something creative, so "Hello World" it is.<P>import javax.swing.*;
import java.awt.event.*;<P>
public class HelloArsJFrame extends JFrame
{
     public HelloArsJFrame()
     {
          JLabel helloArsJLabel = new JLabel("Hello, Ars!");<P>          JButton helloArsJButton = new JButton("Ok");<P>           helloArsJButton.addActionListener(new ActionListener()
           {
                public void actionPerformed(ActionEvent ae)
                {
                     HelloArsJFrame.this.dispose();
                }
           });<P>           this.setSize(300, 300);
           this.getContentPane().setLayout(new BorderLayout());
           this.getContentPane().add(helloArsJLabel, "Center");
           this.getContentPane().add(helloArsJButton, "South");
     }<P>
Ars.java<P>//--------------------------------------------------------------------
// Ars Java Perpetual Program
// Started: 10-24-01
//--------------------------------------------------------------------<P>
public class Ars
{
     public static void main (String[] args)
     {
          System.out.println ("Welcome to the Ars Perpetual Java Program!");
          System.out.println ("Please add some code!");<P>          HelloArsJFrame helloArsJFrame = new HelloArsJFrame();
          helloArsJFrame.setVisible(true);
     }
}


I'm tired.. I doubt this would actually compile, but I'm going to get to sleep instead of trying :p
 
Status
You're currently viewing only LlamaCebu's posts. Click here to go back to viewing the entire thread.
Not open for further replies.