Exer. 3 Combination Lock
/*
Programmer: Albert Ampo
Date Started: March 17,2009
Date Ended: March 19, 2009
*/
import java.awt.*;
import javax.swing.*;
public class CombinationLock extends JFrame {
public static void main (String [] args) {
new CombinationLock().setVisible(true);
}
public CombinationLock () {
Container MyContainer = getContentPane();
MyContainer.setLayout(new FlowLayout());
MyContainer.add(new JButton("0"));
MyContainer.add(new JButton("1"));
MyContainer.add(new JButton("2"));
MyContainer.add(new JButton("3"));
MyContainer.add(new JButton("4"));
MyContainer.add(new JButton("5"));
MyContainer.add(new JButton("6"));
MyContainer.add(new JButton("7"));
MyContainer.add(new JButton("8"));
MyContainer.add(new JButton("9"));
MyContainer.setBackground(Color.green);
pack();
}
}
Wednesday, March 18, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment