-
Notifications
You must be signed in to change notification settings - Fork 0
/
Swing44.java
34 lines (26 loc) · 884 Bytes
/
Swing44.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
import javax.swing.*;
import java.awt.*;
public class Swing44 extends JFrame {
public static void main(String[] args) { new Swing44(); }
JInternalFrame iframe;
Swing44(){
setTitle("JInternalFrame");
setDefaultCloseOperation(EXIT_ON_CLOSE);
setSize(400,400);
setLayout(null);
setLocationRelativeTo(null);
iframe = new JInternalFrame("JinternalFrame2",true,true ,true,true);
initframe(iframe);
add(iframe);
setVisible(true);
validate();
}
private void initframe(JInternalFrame iframe) {
iframe.setSize(300,300);
iframe.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
iframe.setLocation(50,50);
iframe.setVisible(true);
iframe.setLayout(new FlowLayout());
iframe.add(new JButton("MyButton"));
}
}