-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMain.java
More file actions
51 lines (41 loc) · 1.3 KB
/
Copy pathMain.java
File metadata and controls
51 lines (41 loc) · 1.3 KB
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
package chat;
import javax.swing.*;
import java.awt.*;
public class Main extends JFrame {
private static final long serialVersionUID = 1L;
private JPanel jContentPane = null;
private Main() {
super();
initialize();
}
public static void main(String[] args) {
new Main();
}
private void initialize() {
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
this.setSize(420, 450);
this.setContentPane(getJContentPane());
this.setTitle("Chat Programi");
// Ekranda pencereyi gosterelim
this.setVisible(true);
}
private JPanel getJContentPane() {
if (jContentPane == null) {
jContentPane = new JPanel();
// Layout ayarlayalim
jContentPane.setLayout(new BorderLayout());
// Pencereye sunucu ve istemciyi ayri ayri gostermek icin
// tab ekleyelim
jContentPane.add(getTabbedPane());
}
return jContentPane;
}
private JTabbedPane getTabbedPane() {
JTabbedPane tabbedPane = new JTabbedPane();
// Sunucu paneli ekleyelim
tabbedPane.add("Sunucu", new ServerPanel());
// Istemci paneli ekleyelim
tabbedPane.add("İstemci", new ClientPanel());
return tabbedPane;
}
}