- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPanelTest.java
More file actions
Latest commit
24 lines (24 loc) · 637 Bytes
/
Copy pathPanelTest.java
File metadata and controls
24 lines (24 loc) · 637 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
importjava.util.*;
importjava.io.*;
importjava.awt.*;
importjavax.swing.*;
importjava.awt.event.*;
publicclassPanelTestextendsJFrame
{
publicstaticvoidmain(Stringargs[])
{
PanelTestp1 = newPanelTest();
p1.setVisible(true);
}
PanelTest()
{
JPanelpanel = newJPanel(newGridLayout(2,0));
(this.myPanel[0]).add(newJButton("hello1"));
panel.add(myPanel[0]);
(this.myPanel[1]).add(newJButton("hello1"));
panel.add(myPanel[1]);
add(panel, BorderLayout.CENTER);
pack();
}
JPanel[] myPanel = newJPanel[2];
}