teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

あまりにも説明不足だったため修正を加えました

2016/07/15 04:23

投稿

IsiyakiimoO
IsiyakiimoO

スコア8

title CHANGED
File without changes
body CHANGED
@@ -1,18 +1,22 @@
1
1
  [java]TextFieldの中身を引数として持ってくる場合どうしたらよいですか?
2
- TextFieldに書かれた文字をボタンが押されたら一時的に保存されるという風にしたいのですが
2
+ TextFieldに書かれた文字をボタンが押されたら一時的に保存されるという風にしたいのですが
3
3
 
4
+ class hogehoge extends JFrame implements ActionListener{
4
5
  フィールド
5
- new Jpanel;
6
+ keyPanel new Jpanel
6
- new textField
7
+ title_name new textField
7
- new button
8
+ REGIST_button new button
8
9
  関数{
9
- addする
10
+ keyPanel.setLayout(new GridLayout(5,1));
10
- addリスナー
11
+ keyPanel.add(title_name);
12
+ keyPanel.add(REGIST_button);
13
+ REGIST_button.addActionListener(this);
11
14
  }
12
15
  関数2(ActionEvent e){
13
- 変数 = text.getText();
16
+ 変数 = title_name.getText();
14
17
  }
18
+ }
15
19
 
16
20
  という形で関数2の場所で怒られます。
17
-
21
+ (Frane.title_nameは不可視です)
18
22
  java初心者というのもあります。よろしくお願いします。