-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCloudPanel.java
30 lines (27 loc) · 991 Bytes
/
CloudPanel.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
import javax.swing.*;
import javax.swing.tree.*;
public class CloudPanel{
public static JPanel addPane() {
JPanel pane = new JPanel();
pane.setSize(550,250);
pane.setLayout(null);
DefaultMutableTreeNode parent = new DefaultMutableTreeNode("Color", true);
DefaultMutableTreeNode black = new DefaultMutableTreeNode("Black");
DefaultMutableTreeNode blue = new DefaultMutableTreeNode("Blue");
DefaultMutableTreeNode nBlue = new DefaultMutableTreeNode("Navy Blue");
DefaultMutableTreeNode dBlue = new DefaultMutableTreeNode("Dark Blue");
DefaultMutableTreeNode green = new DefaultMutableTreeNode("Green");
DefaultMutableTreeNode white = new DefaultMutableTreeNode("White");
parent.add(black);
parent.add(blue);
blue.add(nBlue);
blue.add(dBlue);
parent.add(green );
parent.add(white);
JTree tree = new JTree(parent);
pane.add(tree);
//pane.setUndecorated(true);
pane.getRootPane(). setWindowDecorationStyle(JRootPane.PLAIN_DIALOG);
return pane;
}
}