//ProgrammerName: Reuben D. matiga
//ProgramName: Combination Lock
//Purpose: To Learned more in java
//Date: March 19,2009
//Instructor: Dony Dongiapon
import java.awt.*;
import javax.swing.*;
public class CombinationLock extends JFrame {
public static void main (String [] args) {
new CombinationLock().setVisible(true);
}
public CombinationLock () {
Container cp = getContentPane();
cp.setLayout(new FlowLayout());
cp.add(new JButton("0"));
cp.add(new JButton("1"));
cp.add(new JButton("2"));
cp.add(new JButton("3"));
cp.add(new JButton("4"));
cp.add(new JButton("5"));
cp.add(new JButton("6"));
cp.add(new JButton("7"));
cp.add(new JButton("8"));
cp.add(new JButton("9"));
cp.setBackground(Color.red);
pack();
}
}
No comments:
Post a Comment