lajdlksadlmla
[rmh3093.git] / lab7 / AddressScreen.java
blobb38f99b7abfaebbdf0c026e10f50cb3578ff0a9e
1 /*
2 * AddressScreen.java
4 * Version:
5 * $Id: AddressScreen.java,v 1.1 2008/04/30 14:28:49 rmh3093 Exp rmh3093 $
7 * Revisions:
8 * $Log: AddressScreen.java,v $
9 * Revision 1.1 2008/04/30 14:28:49 rmh3093
10 * Initial revision
14 import java.awt.*;
15 import javax.swing.*;
17 public class AddressScreen {
19 public AddressScreen() {
20 String[] elements = {"Name","Address","City","State","Zip"};
21 String[] buttons = {"Add","Modify","Delete"};
22 JFrame mainFrame = new JFrame("Address Information");
23 Container mainPane = mainFrame.getContentPane();
24 mainPane.setLayout(new BorderLayout());
25 mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
26 mainFrame.setVisible(true);
27 Container top = new Container();
28 top.setLayout(new GridLayout(5,2));
29 for (String s : elements) {
30 top.add(new JLabel(s));
31 top.add(new JTextField());
33 mainPane.add(top, BorderLayout.CENTER);
34 Container bottom = new Container();
35 bottom.setLayout(new FlowLayout(FlowLayout.CENTER));
36 for (String s : buttons) { bottom.add(new JButton(s)); }
37 mainPane.add(bottom, BorderLayout.SOUTH);
38 mainFrame.pack();
41 /**
42 * Main loop
44 public static void main(String args[]) {
45 new AddressScreen();