質問編集履歴

7

訂正

2019/01/29 05:59

投稿

P_Beginner
P_Beginner

スコア99

test CHANGED
File without changes
test CHANGED
@@ -134,7 +134,7 @@
134
134
 
135
135
  id.setText("");//TextFieldを空(カラ)にする
136
136
 
137
- passwd.setText("");//Passwdを空にする
137
+ passwd.setText("");//PasswdFieldを空にする
138
138
 
139
139
  warning.setText("※正しいアカウント情報を入力してください");
140
140
 

6

訂正

2019/01/29 05:58

投稿

P_Beginner
P_Beginner

スコア99

test CHANGED
File without changes
test CHANGED
@@ -134,7 +134,7 @@
134
134
 
135
135
  id.setText("");//TextFieldを空(カラ)にする
136
136
 
137
- passwd.setText("");//TextFieldを空にする
137
+ passwd.setText("");//Passwdを空にする
138
138
 
139
139
  warning.setText("※正しいアカウント情報を入力してください");
140
140
 

5

訂正

2019/01/29 05:58

投稿

P_Beginner
P_Beginner

スコア99

test CHANGED
File without changes
test CHANGED
@@ -120,7 +120,7 @@
120
120
 
121
121
  passwd.setText("");
122
122
 
123
- warning.setText("OK");
123
+ warning.setText("OK");//本来はここで画面遷移させる
124
124
 
125
125
 
126
126
 
@@ -132,9 +132,9 @@
132
132
 
133
133
  System.out.println("失敗");
134
134
 
135
- id.setText("");
135
+ id.setText("");//TextFieldを空(カラ)にする
136
136
 
137
- passwd.setText("");
137
+ passwd.setText("");//TextFieldを空にする
138
138
 
139
139
  warning.setText("※正しいアカウント情報を入力してください");
140
140
 

4

追記

2019/01/29 05:58

投稿

P_Beginner
P_Beginner

スコア99

test CHANGED
File without changes
test CHANGED
@@ -3,3 +3,149 @@
3
3
  どのようにやれば良いのでしょうか?
4
4
 
5
5
  新しくクラスを生成する必要はありますか?
6
+
7
+
8
+
9
+ ### プログラムソース(Controller.java)
10
+
11
+ ```Java
12
+
13
+ package testSystem;
14
+
15
+
16
+
17
+ import java.net.URL;
18
+
19
+ import java.util.ResourceBundle;
20
+
21
+
22
+
23
+ import javafx.event.ActionEvent;
24
+
25
+ import javafx.fxml.FXML;
26
+
27
+ import javafx.scene.control.Button;
28
+
29
+ import javafx.scene.control.Hyperlink;
30
+
31
+ import javafx.scene.control.Label;
32
+
33
+ import javafx.scene.control.PasswordField;
34
+
35
+ import javafx.scene.control.TextField;
36
+
37
+
38
+
39
+ public class LoginController {
40
+
41
+
42
+
43
+ @FXML
44
+
45
+ private ResourceBundle resources;
46
+
47
+
48
+
49
+ @FXML
50
+
51
+ private URL location;
52
+
53
+
54
+
55
+ @FXML
56
+
57
+ private TextField num;
58
+
59
+
60
+
61
+ @FXML
62
+
63
+ private PasswordField passwd;
64
+
65
+
66
+
67
+ @FXML
68
+
69
+ private Button loginButton;
70
+
71
+
72
+
73
+ @FXML
74
+
75
+ private Hyperlink createLink;
76
+
77
+
78
+
79
+ @FXML
80
+
81
+ private Label warning;
82
+
83
+
84
+
85
+ @FXML
86
+
87
+ void initialize() {
88
+
89
+ assert id != null : "fx:id=\"id\" was not injected: check your FXML file 'Login.fxml'.";
90
+
91
+ assert passwd != null : "fx:id=\"passwd\" was not injected: check your FXML file 'Login.fxml'.";
92
+
93
+ assert loginButton != null : "fx:id=\"loginButton\" was not injected: check your FXML file 'Login.fxml'.";
94
+
95
+ assert createLink != null : "fx:id=\"createLink\" was not injected: check your FXML file 'Login.fxml'.";
96
+
97
+ assert warning != null : "fx:id=\"warning\" was not injected: check your FXML file 'Login.fxml'.";
98
+
99
+ }
100
+
101
+
102
+
103
+ @FXML
104
+
105
+ public void OnClick(ActionEvent event) {
106
+
107
+ String idNumber = id.getText();
108
+
109
+ String password = passwd.getText();
110
+
111
+
112
+
113
+ if(idNumber.equals("test")&&password.equals("test")) {
114
+
115
+ System.out.print("id:"+idNumber+" pass:"+password+" → ");
116
+
117
+ System.out.println("成功");
118
+
119
+ id.setText("");
120
+
121
+ passwd.setText("");
122
+
123
+ warning.setText("OK");
124
+
125
+
126
+
127
+ }
128
+
129
+ else {
130
+
131
+ System.out.print("id:"+idNumber+" pass:"+password+" → ");
132
+
133
+ System.out.println("失敗");
134
+
135
+ id.setText("");
136
+
137
+ passwd.setText("");
138
+
139
+ warning.setText("※正しいアカウント情報を入力してください");
140
+
141
+ }
142
+
143
+ }
144
+
145
+ }
146
+
147
+
148
+
149
+
150
+
151
+ ```

3

訂正

2019/01/29 05:53

投稿

P_Beginner
P_Beginner

スコア99

test CHANGED
File without changes
test CHANGED
@@ -3,149 +3,3 @@
3
3
  どのようにやれば良いのでしょうか?
4
4
 
5
5
  新しくクラスを生成する必要はありますか?
6
-
7
-
8
-
9
- ### ソース(Controller.java)
10
-
11
- ```Java
12
-
13
- package testSystem;
14
-
15
-
16
-
17
- import java.net.URL;
18
-
19
- import java.util.ResourceBundle;
20
-
21
-
22
-
23
- import javafx.event.ActionEvent;
24
-
25
- import javafx.fxml.FXML;
26
-
27
- import javafx.scene.control.Button;
28
-
29
- import javafx.scene.control.Hyperlink;
30
-
31
- import javafx.scene.control.Label;
32
-
33
- import javafx.scene.control.PasswordField;
34
-
35
- import javafx.scene.control.TextField;
36
-
37
-
38
-
39
- public class LoginController {
40
-
41
-
42
-
43
- @FXML
44
-
45
- private ResourceBundle resources;
46
-
47
-
48
-
49
- @FXML
50
-
51
- private URL location;
52
-
53
-
54
-
55
- @FXML
56
-
57
- private TextField id;
58
-
59
-
60
-
61
- @FXML
62
-
63
- private PasswordField passwd;
64
-
65
-
66
-
67
- @FXML
68
-
69
- private Button loginButton;
70
-
71
-
72
-
73
- @FXML
74
-
75
- private Hyperlink createLink;
76
-
77
-
78
-
79
- @FXML
80
-
81
- private Label warning;
82
-
83
-
84
-
85
- @FXML
86
-
87
- void initialize() {
88
-
89
- assert id != null : "fx:id=\"id\" was not injected: check your FXML file 'Login.fxml'.";
90
-
91
- assert passwd != null : "fx:id=\"passwd\" was not injected: check your FXML file 'Login.fxml'.";
92
-
93
- assert loginButton != null : "fx:id=\"loginButton\" was not injected: check your FXML file 'Login.fxml'.";
94
-
95
- assert createLink != null : "fx:id=\"createLink\" was not injected: check your FXML file 'Login.fxml'.";
96
-
97
- assert warning != null : "fx:id=\"warning\" was not injected: check your FXML file 'Login.fxml'.";
98
-
99
- }
100
-
101
-
102
-
103
- @FXML public void OnClick(ActionEvent event) {
104
-
105
- String loginId = id.getText();
106
-
107
- String password = passwd.getText();
108
-
109
-
110
-
111
-
112
-
113
- if(loginId.equals("test")&&password.equals("test")) {
114
-
115
- System.out.print("id:"+loginId+" pass:"+password+" → ");
116
-
117
- System.out.println("成功");
118
-
119
- id.setText("");//ログインボタン押下でテキストフィールドを空にする
120
-
121
- passwd.setText("");//ログインボタン押下でテキストフィールドを空にする
122
-
123
- warning.setText("OK");//認証でOK表示
124
-
125
-
126
-
127
- }
128
-
129
- else {
130
-
131
- System.out.print("id:"+loginId+" pass:"+password+" → ");
132
-
133
- System.out.println("失敗");
134
-
135
- id.setText("");
136
-
137
- passwd.setText("");
138
-
139
- warning.setText("※正しいアカウント情報を入力してください");//認証しない場合はエラーメッセージ表示
140
-
141
- }
142
-
143
- }
144
-
145
- }
146
-
147
-
148
-
149
-
150
-
151
- ```

2

訂正

2019/01/29 04:44

投稿

P_Beginner
P_Beginner

スコア99

test CHANGED
File without changes
test CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  ```Java
12
12
 
13
- package kouketsuSystem;
13
+ package testSystem;
14
14
 
15
15
 
16
16
 

1

追記

2019/01/29 02:04

投稿

P_Beginner
P_Beginner

スコア99

test CHANGED
File without changes
test CHANGED
@@ -3,3 +3,149 @@
3
3
  どのようにやれば良いのでしょうか?
4
4
 
5
5
  新しくクラスを生成する必要はありますか?
6
+
7
+
8
+
9
+ ### ソース(Controller.java)
10
+
11
+ ```Java
12
+
13
+ package kouketsuSystem;
14
+
15
+
16
+
17
+ import java.net.URL;
18
+
19
+ import java.util.ResourceBundle;
20
+
21
+
22
+
23
+ import javafx.event.ActionEvent;
24
+
25
+ import javafx.fxml.FXML;
26
+
27
+ import javafx.scene.control.Button;
28
+
29
+ import javafx.scene.control.Hyperlink;
30
+
31
+ import javafx.scene.control.Label;
32
+
33
+ import javafx.scene.control.PasswordField;
34
+
35
+ import javafx.scene.control.TextField;
36
+
37
+
38
+
39
+ public class LoginController {
40
+
41
+
42
+
43
+ @FXML
44
+
45
+ private ResourceBundle resources;
46
+
47
+
48
+
49
+ @FXML
50
+
51
+ private URL location;
52
+
53
+
54
+
55
+ @FXML
56
+
57
+ private TextField id;
58
+
59
+
60
+
61
+ @FXML
62
+
63
+ private PasswordField passwd;
64
+
65
+
66
+
67
+ @FXML
68
+
69
+ private Button loginButton;
70
+
71
+
72
+
73
+ @FXML
74
+
75
+ private Hyperlink createLink;
76
+
77
+
78
+
79
+ @FXML
80
+
81
+ private Label warning;
82
+
83
+
84
+
85
+ @FXML
86
+
87
+ void initialize() {
88
+
89
+ assert id != null : "fx:id=\"id\" was not injected: check your FXML file 'Login.fxml'.";
90
+
91
+ assert passwd != null : "fx:id=\"passwd\" was not injected: check your FXML file 'Login.fxml'.";
92
+
93
+ assert loginButton != null : "fx:id=\"loginButton\" was not injected: check your FXML file 'Login.fxml'.";
94
+
95
+ assert createLink != null : "fx:id=\"createLink\" was not injected: check your FXML file 'Login.fxml'.";
96
+
97
+ assert warning != null : "fx:id=\"warning\" was not injected: check your FXML file 'Login.fxml'.";
98
+
99
+ }
100
+
101
+
102
+
103
+ @FXML public void OnClick(ActionEvent event) {
104
+
105
+ String loginId = id.getText();
106
+
107
+ String password = passwd.getText();
108
+
109
+
110
+
111
+
112
+
113
+ if(loginId.equals("test")&&password.equals("test")) {
114
+
115
+ System.out.print("id:"+loginId+" pass:"+password+" → ");
116
+
117
+ System.out.println("成功");
118
+
119
+ id.setText("");//ログインボタン押下でテキストフィールドを空にする
120
+
121
+ passwd.setText("");//ログインボタン押下でテキストフィールドを空にする
122
+
123
+ warning.setText("OK");//認証でOK表示
124
+
125
+
126
+
127
+ }
128
+
129
+ else {
130
+
131
+ System.out.print("id:"+loginId+" pass:"+password+" → ");
132
+
133
+ System.out.println("失敗");
134
+
135
+ id.setText("");
136
+
137
+ passwd.setText("");
138
+
139
+ warning.setText("※正しいアカウント情報を入力してください");//認証しない場合はエラーメッセージ表示
140
+
141
+ }
142
+
143
+ }
144
+
145
+ }
146
+
147
+
148
+
149
+
150
+
151
+ ```