Friday, April 13, 2007

Valentine

import javax.swing.*;
import java.awt.*;
public class Valentine extends JFrame{
Container pane;
JButton b;
JTextField c;
public static void main(String[] args){
Valentine valdate = new Valentine();
valdate.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
valdate.setSize(400,300);
valdate.setVisible(true);
}

public Valentine(){
// ds
String[] stars = {"Robert Redford","Manilyn Monroe","Boris Karloff","Lassie","Hopalang Cassidy","Trigger","Tom Hanks","Russel Crowe","Lone Ranger","Zorro"};

String output="",Dates;
//super ("SUPER");
pane=getContentPane();
//pane.LayOut("null");
//pick the your valentine date by random
b=new JButton("OK");
b.setBounds(50,50,10,10);
pane.add(b);
//c=new JTextField(10);
//pane.add(c);
//0c.setBounds(100,100,100,100);
/*output +="Your Valentine Date is\n";
Dates = stars[(int)(stars.length*Math.random())];
output+=Dates;

JOptionPane.showMessageDialog(null,output,"Your Valentine Date is", JOptionPane.INFORMATION_MESSAGE);
System.exit(0);*/
}
}

No comments: