GUI better

git-svn-id: svn://anubis/gvsu@23 45c1a28c-8058-47b2-ae61-ca45b979098e
This commit is contained in:
josh 2008-03-08 16:57:18 +00:00
parent 39b6c90811
commit 0804d210f0

View File

@ -4,19 +4,50 @@ import javax.swing.*;
public class KaZaGUI extends JFrame public class KaZaGUI extends JFrame
{ {
private JButton m_browseButton;
private JButton m_connectButton;
public KaZaGUI() public KaZaGUI()
{ {
super("Josh's KaZa application for CS654!"); super("Josh's KaZa application for CS654!");
setDefaultCloseOperation(EXIT_ON_CLOSE); setDefaultCloseOperation(EXIT_ON_CLOSE);
setSize(400, 400); setSize(600, 400);
setVisible(true); setVisible(true);
Container c = getContentPane(); Container c = getContentPane();
JTabbedPane pane = new JTabbedPane(); JTabbedPane pane = new JTabbedPane();
c.add(pane); c.add(pane);
JPanel clientPanel = new JPanel(new BorderLayout()); JPanel clientPanel = new JPanel();
clientPanel.setLayout(new BoxLayout(clientPanel, BoxLayout.Y_AXIS));
JPanel p = new JPanel();
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
p.add(new JLabel("User name: "));
p.add(new JTextField());
clientPanel.add(p);
p = new JPanel();
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
p.add(new JLabel("Connection speed: "));
p.add(new JTextField());
clientPanel.add(p);
p = new JPanel();
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
p.add(new JLabel("Shared folder: "));
p.add(new JTextField());
m_browseButton = new JButton("...");
p.add(m_browseButton);
clientPanel.add(p);
clientPanel.add(Box.createVerticalGlue());
clientPanel.add(new Box.Filler(new Dimension(0, 0),
new Dimension(0, Short.MAX_VALUE),
new Dimension(Short.MAX_VALUE,
Short.MAX_VALUE)));
p = new JPanel();
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
m_connectButton = new JButton("Connect");
p.add(m_connectButton);
clientPanel.add(p);
pane.add("Client", clientPanel); pane.add("Client", clientPanel);
JPanel transferPanel = new JPanel(new BorderLayout()); JPanel transferPanel = new JPanel(new BorderLayout());