質問編集履歴
1
修正箇所を修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -22,12 +22,11 @@
|
|
22
22
|
import javax.swing.JOptionPane;
|
23
23
|
import javax.swing.JPanel;
|
24
24
|
|
25
|
-
import game.Main;
|
26
25
|
public class MainFrame extends JFrame{
|
27
26
|
public String[] PanelNames = {"First","Second","Third"};
|
28
|
-
FirstPanel fp = new FirstPanel(
|
27
|
+
FirstPanel fp = new FirstPanel(PanelNames[0]);
|
29
|
-
SecondPanel sp = new SecondPanel(
|
28
|
+
SecondPanel sp = new SecondPanel(PanelNames[1]);
|
30
|
-
ThirdPanel tp = new ThirdPanel(
|
29
|
+
ThirdPanel tp = new ThirdPanel(PanelNames[2]);
|
31
30
|
public JPanel[] jps = {fp,sp,tp};
|
32
31
|
|
33
32
|
int i;
|
@@ -36,11 +35,11 @@
|
|
36
35
|
private static final int HORIZONTAL = 1024;
|
37
36
|
|
38
37
|
public MainFrame(){
|
39
|
-
super(
|
38
|
+
super("Test");
|
40
39
|
|
41
|
-
this.add(fp);
|
40
|
+
this.add(fp);fp.setVisible(true);
|
42
|
-
this.add(sp);
|
41
|
+
this.add(sp);sp.setVisible(false);
|
43
|
-
this.add(tp);
|
42
|
+
this.add(tp);tp.setVisible(false);
|
44
43
|
|
45
44
|
setBounds(100, 100, 300, 250);
|
46
45
|
|
@@ -124,7 +123,6 @@
|
|
124
123
|
import javax.swing.JLabel;
|
125
124
|
import javax.swing.JPanel;
|
126
125
|
|
127
|
-
//4/22
|
128
126
|
public class FirstPanel extends JPanel implements ActionListener{
|
129
127
|
String str;
|
130
128
|
|