-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainWindow.java
70 lines (62 loc) · 1.84 KB
/
mainWindow.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextField;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class mainWindow extends JFrame {
private JPanel contentPane;
ServerWindow server = new ServerWindow();
ClientWindow client = new ClientWindow();
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
mainWindow frame = new mainWindow();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public mainWindow() {
setResizable(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 122);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JButton btnServerHosten = new JButton("Server hosten");
btnServerHosten.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
server.setVisible(true);
btnServerHosten.setEnabled(false);
}
});
btnServerHosten.setBounds(10, 45, 120, 23);
contentPane.add(btnServerHosten);
JButton btnClientStarten = new JButton("Client starten");
btnClientStarten.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
client.setVisible(true);
}
});
btnClientStarten.setBounds(10, 11, 120, 23);
contentPane.add(btnClientStarten);
JLabel lblImNetzwerkNach = new JLabel("Im Netzwerk nach Spielen suchen...");
lblImNetzwerkNach.setBounds(154, 15, 213, 14);
contentPane.add(lblImNetzwerkNach);
}
}