svn:ignore set to *.class, GUI code reorgged slightly
git-svn-id: svn://anubis/gvsu@25 45c1a28c-8058-47b2-ae61-ca45b979098e
This commit is contained in:
parent
858e0b2976
commit
a7152d51ed
@ -9,6 +9,9 @@ public class KaZaGUI extends JFrame
|
|||||||
private JButton m_connectButton;
|
private JButton m_connectButton;
|
||||||
private JButton m_closeButton;
|
private JButton m_closeButton;
|
||||||
private JTextField m_shareFolderField;
|
private JTextField m_shareFolderField;
|
||||||
|
private JTextField m_statusField;
|
||||||
|
private JTextField m_serverField;
|
||||||
|
private ActionEventHandler m_handler;
|
||||||
|
|
||||||
public KaZaGUI()
|
public KaZaGUI()
|
||||||
{
|
{
|
||||||
@ -18,47 +21,13 @@ public class KaZaGUI extends JFrame
|
|||||||
setSize(600, 400);
|
setSize(600, 400);
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
|
|
||||||
ActionEventHandler handler = new ActionEventHandler(this);
|
m_handler = new ActionEventHandler(this);
|
||||||
|
|
||||||
Container c = getContentPane();
|
Container c = getContentPane();
|
||||||
JTabbedPane pane = new JTabbedPane();
|
JTabbedPane pane = new JTabbedPane();
|
||||||
c.add(pane);
|
c.add(pane);
|
||||||
|
|
||||||
JPanel clientPanel = new JPanel();
|
JPanel clientPanel = getClientPanel();
|
||||||
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: "));
|
|
||||||
m_shareFolderField = new JTextField();
|
|
||||||
p.add(m_shareFolderField);
|
|
||||||
m_browseButton = new JButton("...");
|
|
||||||
m_browseButton.addActionListener(handler);
|
|
||||||
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");
|
|
||||||
m_connectButton.addActionListener(handler);
|
|
||||||
p.add(m_connectButton);
|
|
||||||
m_closeButton = new JButton("Close");
|
|
||||||
m_closeButton.addActionListener(handler);
|
|
||||||
p.add(m_closeButton);
|
|
||||||
clientPanel.add(p);
|
|
||||||
pane.add("Client", clientPanel);
|
pane.add("Client", clientPanel);
|
||||||
|
|
||||||
JPanel transferPanel = new JPanel(new BorderLayout());
|
JPanel transferPanel = new JPanel(new BorderLayout());
|
||||||
@ -92,4 +61,58 @@ public class KaZaGUI extends JFrame
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private JPanel getClientPanel()
|
||||||
|
{
|
||||||
|
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: "));
|
||||||
|
m_shareFolderField = new JTextField();
|
||||||
|
p.add(m_shareFolderField);
|
||||||
|
m_browseButton = new JButton("...");
|
||||||
|
m_browseButton.addActionListener(m_handler);
|
||||||
|
p.add(m_browseButton);
|
||||||
|
clientPanel.add(p);
|
||||||
|
p = new JPanel();
|
||||||
|
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
|
||||||
|
p.add(new JLabel("Server: "));
|
||||||
|
m_serverField = new JTextField();
|
||||||
|
p.add(m_serverField);
|
||||||
|
clientPanel.add(p);
|
||||||
|
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_statusField = new JTextField();
|
||||||
|
p.add(m_statusField);
|
||||||
|
p.add(new Box.Filler(new Dimension(0, 0),
|
||||||
|
new Dimension(Short.MAX_VALUE, 0),
|
||||||
|
new Dimension(Short.MAX_VALUE, Short.MAX_VALUE)));
|
||||||
|
m_connectButton = new JButton("Connect");
|
||||||
|
m_connectButton.addActionListener(m_handler);
|
||||||
|
p.add(m_connectButton);
|
||||||
|
p.add(new Box.Filler(new Dimension(8, 0),
|
||||||
|
new Dimension(8, 0),
|
||||||
|
new Dimension(8, Short.MAX_VALUE)));
|
||||||
|
m_closeButton = new JButton("Close");
|
||||||
|
m_closeButton.addActionListener(m_handler);
|
||||||
|
p.add(m_closeButton);
|
||||||
|
clientPanel.add(p);
|
||||||
|
|
||||||
|
return clientPanel;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user