-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTable.java
More file actions
45 lines (33 loc) · 886 Bytes
/
Table.java
File metadata and controls
45 lines (33 loc) · 886 Bytes
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
package GUI;
import javax.swing.*;
import java.awt.*;
public class Table extends JFrame {
private JPanel panel;
private JMenuBar menuBar;
private JMenuItem menuItem;
private JMenu menu;
private JButton button;
private JLabel label;
private JTable table;
public Table() {
setTitle("table");
setSize(200,400);
build();
add(panel);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public void build(){
button = new JButton("save");
label = new JLabel("TABALE");
table = new JTable(12,23);
String[] name = {"adugnaw" , "etunat", "bemnet", "hilina"};
panel = new JPanel();
panel.add(label);
panel.add(table);
panel.add(button);
}
public static void main(String[] args) {
new Table();
}
}