-
Notifications
You must be signed in to change notification settings - Fork 0
/
WestJPanel.java
107 lines (67 loc) · 2.38 KB
/
WestJPanel.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
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
99
100
101
102
103
104
105
106
107
package betterthanpaint;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import javax.swing.Box;
import javax.swing.ButtonGroup;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
import javax.swing.event.ChangeListener;
public class WestJPanel extends CentralJPanel implements ActionListener {
public WestJPanel() {
Object ini = new DrawAndType();
//set the dimention for the panel
this.setPreferredSize(new Dimension(100,140));
setBackground(Color.gray);
JLabel jl3 = new JLabel("Choose Sizes");
add(jl3);
GridBagConstraints layoutCon = new GridBagConstraints();
layoutCon.insets = new Insets(5,5,5,5);
shapeSize = new JLabel(" Shape ");
add(shapeSize);
circleSize = 10;
// creating the text field for the circle size
circleSizing = new JTextField(3);
add(circleSizing);
circleSizing.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e) {
circleSize = Integer.parseInt(circleSizing.getText());
System.out.println(circleSize);
}});
textSize = new JLabel(" Font ");
add(textSize);
// create the text field for the font
fontSizing = new JTextField(3);
add(fontSizing);
fontSizing.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
fontSize = Integer.parseInt(fontSizing.getText());
System.out.println("test");
}});
}
public void rune() throws IOException{
if ((fontSize)!= Integer.parseInt(fontSizing.getText())){
throw new IOException("Only number Please");
}
else if ((circleSize)!= Integer.parseInt(circleSizing.getText())){
throw new IOException("Only number Please");
}
}
public void actionPerformed(ActionEvent e) {
}
}