質問編集履歴
1
title
CHANGED
File without changes
|
body
CHANGED
@@ -17,7 +17,124 @@
|
|
17
17
|
|
18
18
|
###該当のソースコード
|
19
19
|
```java
|
20
|
+
package reidai;
|
21
|
+
import java.awt.BorderLayout;
|
22
|
+
import java.awt.EventQueue;
|
23
|
+
import javax.swing.ButtonGroup;
|
24
|
+
import javax.swing.JFrame;
|
25
|
+
import javax.swing.JPanel;
|
26
|
+
import javax.swing.border.EmptyBorder;
|
27
|
+
import javax.swing.JScrollPane;
|
28
|
+
import javax.swing.JList;
|
29
|
+
import javax.swing.JTextField;
|
30
|
+
import java.awt.FlowLayout;
|
31
|
+
import javax.swing.JLabel;
|
32
|
+
import java.awt.Dimension;
|
33
|
+
import javax.swing.JButton;
|
34
|
+
import java.awt.event.ActionListener;
|
35
|
+
import java.awt.event.ActionEvent;
|
36
|
+
import java.io.BufferedReader;
|
37
|
+
import java.io.File;
|
38
|
+
import java.io.FileReader;
|
39
|
+
import java.io.IOException;
|
40
|
+
import javax.swing.event.ListSelectionListener;
|
41
|
+
import javax.swing.event.ListSelectionEvent;
|
42
|
+
import java.awt.GridLayout;
|
43
|
+
import java.awt.Component;
|
44
|
+
import javax.swing.SwingConstants;
|
45
|
+
import javax.swing.ScrollPaneConstants;
|
46
|
+
import java.util.ArrayList;
|
47
|
+
import java.awt.BorderLayout;
|
48
|
+
import java.awt.EventQueue;
|
49
|
+
import java.awt.event.ActionEvent;
|
50
|
+
import javax.swing.JRadioButton;
|
51
|
+
import javax.swing.JComboBox;
|
52
|
+
public class Rei4_09 extends JFrame {
|
53
|
+
private static final long serialVersionUID = 1L;
|
54
|
+
private JPanel contentPane;
|
55
|
+
private JPanel panelCenter;
|
56
|
+
private JTextField textField01;
|
57
|
+
private JTextField textField02;
|
58
|
+
private JTextField textField03;
|
59
|
+
private JLabel label01;
|
60
|
+
private JLabel label02;
|
61
|
+
private JScrollPane scrollPane;
|
62
|
+
private JList list;
|
63
|
+
private JList list1;
|
64
|
+
private JLabel label03;
|
65
|
+
private JButton button;
|
66
|
+
private JPanel panel4;
|
67
|
+
private JPanel panel3;
|
68
|
+
private JPanel panel2;
|
69
|
+
private JPanel panel1;
|
70
|
+
private JRadioButton radioButton01;
|
71
|
+
private JRadioButton radioButton02;
|
72
|
+
private JComboBox comboBox;
|
73
|
+
private JRadioButton aBunkabu;
|
74
|
+
private JRadioButton aUndoubu;
|
75
|
+
private final static int MAX=60;
|
76
|
+
private int buinsu[];
|
77
|
+
private int buinsu1[];
|
78
|
+
private String[] aseito=new String[MAX];
|
79
|
+
private String[] bseito=new String[MAX];
|
80
|
+
|
81
|
+
public static void main(String[] args) {
|
82
|
+
EventQueue.invokeLater(new Runnable() {
|
83
|
+
public void run() {
|
84
|
+
try {
|
85
|
+
Rei4_09 frame = new Rei4_09();
|
86
|
+
frame.setVisible(true);
|
87
|
+
} catch (Exception e) {
|
88
|
+
e.printStackTrace();
|
89
|
+
}
|
90
|
+
}
|
91
|
+
});
|
92
|
+
}
|
93
|
+
|
94
|
+
public Rei4_09() {
|
95
|
+
|
96
|
+
setTitle("リストとファイル");
|
97
|
+
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
98
|
+
setBounds(100, 100, 700,250);
|
99
|
+
contentPane = new JPanel();
|
100
|
+
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
|
101
|
+
contentPane.setLayout(new BorderLayout(0, 0));
|
102
|
+
setContentPane(contentPane);
|
103
|
+
panelCenter = new JPanel();
|
104
|
+
contentPane.add(panelCenter, BorderLayout.CENTER);
|
105
|
+
panelCenter.setLayout(new GridLayout(2, 1, 0, 0));
|
106
|
+
|
107
|
+
|
108
|
+
panel1 = new JPanel();
|
109
|
+
panel1.setAlignmentY(Component.BOTTOM_ALIGNMENT);
|
110
|
+
panelCenter.add(panel1);
|
111
|
+
panel1.setLayout(new GridLayout(6, 1, 0, 0));
|
112
|
+
|
113
|
+
label01 = new JLabel("クラブ名");
|
114
|
+
panel1.add(label01);
|
115
|
+
label01.setHorizontalAlignment(SwingConstants.LEFT);
|
116
|
+
textField01 = new JTextField();
|
117
|
+
panel1.add(textField01);
|
118
|
+
textField01.setColumns(10);
|
119
|
+
label02 = new JLabel("部員数");
|
120
|
+
label02.setHorizontalAlignment(SwingConstants.LEFT);
|
121
|
+
panel1.add(label02);
|
122
|
+
textField02 = new JTextField();
|
123
|
+
panel1.add(textField02);
|
124
|
+
textField02.setColumns(10);
|
125
|
+
|
126
|
+
label03 = new JLabel("クラブ名2");
|
127
|
+
panel1.add(label03);
|
128
|
+
label03.setHorizontalAlignment(SwingConstants.LEFT);
|
129
|
+
textField03 = new JTextField();
|
130
|
+
panel1.add(textField03);
|
131
|
+
textField03.setColumns(10);
|
132
|
+
|
133
|
+
panel2 = new JPanel();
|
134
|
+
FlowLayout fl_panel2 = (FlowLayout) panel2.getLayout();
|
135
|
+
fl_panel2.setAlignment(FlowLayout.RIGHT);
|
136
|
+
panelCenter.add(panel2);
|
20
|
-
|
137
|
+
radioButton01 = new JRadioButton("運動部");
|
21
138
|
radioButton01.addActionListener(new ActionListener() {
|
22
139
|
public void actionPerformed(ActionEvent e) {
|
23
140
|
ArrayList<String> tmpAL=new ArrayList<String>(MAX);
|