-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJtree.java
More file actions
executable file
·98 lines (77 loc) · 2.41 KB
/
Jtree.java
File metadata and controls
executable file
·98 lines (77 loc) · 2.41 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.SystemColor;
import javax.swing.JLabel;
import java.awt.Font;
import java.awt.Graphics;
import javax.swing.SwingConstants;
import java.awt.Color;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
/**
* Write a description of class Jtree here.
*
* @author (Kelvin Likollari)
* @version (04.06.2021)
*/
public class Jtree extends JFrame {
private JPanel contentPane;
JLabel test = new JLabel("");
JPanel tree = new JPanel();
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Jtree frame = new Jtree();
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public Jtree() {
this.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
if (e.getKeyChar() == 'd' || e.getKeyChar() == 'r') {
System.exit(0);
}
}
});
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 704, 446);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JPanel panel = new JPanel();
panel.setForeground(Color.WHITE);
panel.setBackground(SystemColor.inactiveCaption);
panel.setBounds(0, 0, 688, 407);
contentPane.add(panel);
panel.setLayout(null);
JLabel lblNewLabel = new JLabel("The Tree for your Expression is : ");
lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 14));
lblNewLabel.setBounds(117, 23, 474, 43);
panel.add(lblNewLabel);
test.setBounds(168, 77, 348, 25);
panel.add(test);
tree.setBounds(10, 113, 668, 286);
tree.setLayout (new BorderLayout());
tree.setBorder (BorderFactory.createEtchedBorder ());
panel.add(tree);
JLabel lblNewLabel_4 = new JLabel("(c) Kelvin Likollari");
lblNewLabel_4.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel_4.setForeground(new Color(255, 45, 0));
lblNewLabel_4.setFont(new Font("Arial", Font.BOLD, 18));
lblNewLabel_4.setBounds(150, -30, 367, 85);
panel.add(lblNewLabel_4);
}
}