質問編集履歴
1
test
CHANGED
File without changes
|
test
CHANGED
@@ -36,7 +36,241 @@
|
|
36
36
|
|
37
37
|
```java
|
38
38
|
|
39
|
+
package reidai;
|
40
|
+
|
41
|
+
import java.awt.BorderLayout;
|
42
|
+
|
43
|
+
import java.awt.EventQueue;
|
44
|
+
|
45
|
+
import javax.swing.ButtonGroup;
|
46
|
+
|
47
|
+
import javax.swing.JFrame;
|
48
|
+
|
49
|
+
import javax.swing.JPanel;
|
50
|
+
|
51
|
+
import javax.swing.border.EmptyBorder;
|
52
|
+
|
53
|
+
import javax.swing.JScrollPane;
|
54
|
+
|
55
|
+
import javax.swing.JList;
|
56
|
+
|
57
|
+
import javax.swing.JTextField;
|
58
|
+
|
59
|
+
import java.awt.FlowLayout;
|
60
|
+
|
61
|
+
import javax.swing.JLabel;
|
62
|
+
|
63
|
+
import java.awt.Dimension;
|
64
|
+
|
65
|
+
import javax.swing.JButton;
|
66
|
+
|
67
|
+
import java.awt.event.ActionListener;
|
68
|
+
|
69
|
+
import java.awt.event.ActionEvent;
|
70
|
+
|
71
|
+
import java.io.BufferedReader;
|
72
|
+
|
73
|
+
import java.io.File;
|
74
|
+
|
75
|
+
import java.io.FileReader;
|
76
|
+
|
77
|
+
import java.io.IOException;
|
78
|
+
|
79
|
+
import javax.swing.event.ListSelectionListener;
|
80
|
+
|
81
|
+
import javax.swing.event.ListSelectionEvent;
|
82
|
+
|
83
|
+
import java.awt.GridLayout;
|
84
|
+
|
85
|
+
import java.awt.Component;
|
86
|
+
|
87
|
+
import javax.swing.SwingConstants;
|
88
|
+
|
89
|
+
import javax.swing.ScrollPaneConstants;
|
90
|
+
|
91
|
+
import java.util.ArrayList;
|
92
|
+
|
93
|
+
import java.awt.BorderLayout;
|
94
|
+
|
95
|
+
import java.awt.EventQueue;
|
96
|
+
|
97
|
+
import java.awt.event.ActionEvent;
|
98
|
+
|
99
|
+
import javax.swing.JRadioButton;
|
100
|
+
|
101
|
+
import javax.swing.JComboBox;
|
102
|
+
|
103
|
+
public class Rei4_09 extends JFrame {
|
104
|
+
|
105
|
+
private static final long serialVersionUID = 1L;
|
106
|
+
|
107
|
+
private JPanel contentPane;
|
108
|
+
|
109
|
+
private JPanel panelCenter;
|
110
|
+
|
111
|
+
private JTextField textField01;
|
112
|
+
|
113
|
+
private JTextField textField02;
|
114
|
+
|
115
|
+
private JTextField textField03;
|
116
|
+
|
117
|
+
private JLabel label01;
|
118
|
+
|
119
|
+
private JLabel label02;
|
120
|
+
|
121
|
+
private JScrollPane scrollPane;
|
122
|
+
|
123
|
+
private JList list;
|
124
|
+
|
125
|
+
private JList list1;
|
126
|
+
|
127
|
+
private JLabel label03;
|
128
|
+
|
129
|
+
private JButton button;
|
130
|
+
|
131
|
+
private JPanel panel4;
|
132
|
+
|
133
|
+
private JPanel panel3;
|
134
|
+
|
135
|
+
private JPanel panel2;
|
136
|
+
|
137
|
+
private JPanel panel1;
|
138
|
+
|
139
|
+
private JRadioButton radioButton01;
|
140
|
+
|
141
|
+
private JRadioButton radioButton02;
|
142
|
+
|
143
|
+
private JComboBox comboBox;
|
144
|
+
|
145
|
+
private JRadioButton aBunkabu;
|
146
|
+
|
147
|
+
private JRadioButton aUndoubu;
|
148
|
+
|
149
|
+
private final static int MAX=60;
|
150
|
+
|
151
|
+
private int buinsu[];
|
152
|
+
|
153
|
+
private int buinsu1[];
|
154
|
+
|
155
|
+
private String[] aseito=new String[MAX];
|
156
|
+
|
157
|
+
private String[] bseito=new String[MAX];
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
public static void main(String[] args) {
|
162
|
+
|
163
|
+
EventQueue.invokeLater(new Runnable() {
|
164
|
+
|
165
|
+
public void run() {
|
166
|
+
|
167
|
+
try {
|
168
|
+
|
169
|
+
Rei4_09 frame = new Rei4_09();
|
170
|
+
|
171
|
+
frame.setVisible(true);
|
172
|
+
|
173
|
+
} catch (Exception e) {
|
174
|
+
|
175
|
+
e.printStackTrace();
|
176
|
+
|
177
|
+
}
|
178
|
+
|
179
|
+
}
|
180
|
+
|
181
|
+
});
|
182
|
+
|
183
|
+
}
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
public Rei4_09() {
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
setTitle("リストとファイル");
|
192
|
+
|
193
|
+
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
194
|
+
|
195
|
+
setBounds(100, 100, 700,250);
|
196
|
+
|
197
|
+
contentPane = new JPanel();
|
198
|
+
|
199
|
+
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
|
200
|
+
|
201
|
+
contentPane.setLayout(new BorderLayout(0, 0));
|
202
|
+
|
203
|
+
setContentPane(contentPane);
|
204
|
+
|
205
|
+
panelCenter = new JPanel();
|
206
|
+
|
207
|
+
contentPane.add(panelCenter, BorderLayout.CENTER);
|
208
|
+
|
209
|
+
panelCenter.setLayout(new GridLayout(2, 1, 0, 0));
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
panel1 = new JPanel();
|
216
|
+
|
217
|
+
panel1.setAlignmentY(Component.BOTTOM_ALIGNMENT);
|
218
|
+
|
219
|
+
panelCenter.add(panel1);
|
220
|
+
|
221
|
+
panel1.setLayout(new GridLayout(6, 1, 0, 0));
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
label01 = new JLabel("クラブ名");
|
226
|
+
|
227
|
+
panel1.add(label01);
|
228
|
+
|
229
|
+
label01.setHorizontalAlignment(SwingConstants.LEFT);
|
230
|
+
|
231
|
+
textField01 = new JTextField();
|
232
|
+
|
233
|
+
panel1.add(textField01);
|
234
|
+
|
235
|
+
textField01.setColumns(10);
|
236
|
+
|
237
|
+
label02 = new JLabel("部員数");
|
238
|
+
|
239
|
+
label02.setHorizontalAlignment(SwingConstants.LEFT);
|
240
|
+
|
241
|
+
panel1.add(label02);
|
242
|
+
|
243
|
+
textField02 = new JTextField();
|
244
|
+
|
245
|
+
panel1.add(textField02);
|
246
|
+
|
247
|
+
textField02.setColumns(10);
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
label03 = new JLabel("クラブ名2");
|
252
|
+
|
253
|
+
panel1.add(label03);
|
254
|
+
|
255
|
+
label03.setHorizontalAlignment(SwingConstants.LEFT);
|
256
|
+
|
257
|
+
textField03 = new JTextField();
|
258
|
+
|
259
|
+
panel1.add(textField03);
|
260
|
+
|
261
|
+
textField03.setColumns(10);
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
panel2 = new JPanel();
|
266
|
+
|
267
|
+
FlowLayout fl_panel2 = (FlowLayout) panel2.getLayout();
|
268
|
+
|
269
|
+
fl_panel2.setAlignment(FlowLayout.RIGHT);
|
270
|
+
|
271
|
+
panelCenter.add(panel2);
|
272
|
+
|
39
|
-
|
273
|
+
radioButton01 = new JRadioButton("運動部");
|
40
274
|
|
41
275
|
radioButton01.addActionListener(new ActionListener() {
|
42
276
|
|