質問編集履歴
5
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -142,7 +142,7 @@
|
|
142
142
|
|
143
143
|
stage.setScene(scene);
|
144
144
|
|
145
|
-
stage.setTitle("
|
145
|
+
stage.setTitle("一覧");
|
146
146
|
|
147
147
|
stage.show();
|
148
148
|
|
@@ -180,7 +180,7 @@
|
|
180
180
|
|
181
181
|
stage.setScene(scene);
|
182
182
|
|
183
|
-
stage.setTitle("
|
183
|
+
stage.setTitle("一覧");
|
184
184
|
|
185
185
|
stage.show();
|
186
186
|
|
4
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -331,3 +331,33 @@
|
|
331
331
|
... 58 more
|
332
332
|
|
333
333
|
```
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
###追記3
|
340
|
+
|
341
|
+
```java
|
342
|
+
|
343
|
+
FXMLLoader loader = new FXMLLoader(getClass().getResource("KANRIMENU.fxml")); //KANRIMENU→例で行くとmain
|
344
|
+
|
345
|
+
Parent parent = loader.load();
|
346
|
+
|
347
|
+
Scene scene = new Scene(parent);
|
348
|
+
|
349
|
+
KANRIMENUController controller = loader.<KANRIMENUController>getController();
|
350
|
+
|
351
|
+
scene.getAccelerators().put(KeyCodeCombination.valueOf("ESCAPE"), () -> controller.buttonEsc.fire()); //ここで指定するボタンは例で行くとappの画面にあるものです
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
Stage stage = new Stage();
|
356
|
+
|
357
|
+
stage.setScene(scene);
|
358
|
+
|
359
|
+
stage.setTitle("メインメニュー");//メインメニューは例で行くとappです
|
360
|
+
|
361
|
+
stage.show();
|
362
|
+
|
363
|
+
```
|
3
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -159,3 +159,175 @@
|
|
159
159
|
}
|
160
160
|
|
161
161
|
```
|
162
|
+
|
163
|
+
###追記2
|
164
|
+
|
165
|
+
```java
|
166
|
+
|
167
|
+
try {
|
168
|
+
|
169
|
+
FXMLLoader loader = new FXMLLoader(getClass().getResource("Ndenpyo.fxml"));
|
170
|
+
|
171
|
+
Parent parent = loader.load();
|
172
|
+
|
173
|
+
Scene scene = new Scene(parent);
|
174
|
+
|
175
|
+
Stage stage = new Stage();
|
176
|
+
|
177
|
+
KANRIMENUController controller = loader.<KANRIMENUController>getController();
|
178
|
+
|
179
|
+
scene.getAccelerators().put(KeyCodeCombination.valueOf("F2"), () ->controller.buttonF2.fire());
|
180
|
+
|
181
|
+
stage.setScene(scene);
|
182
|
+
|
183
|
+
stage.setTitle("入荷伝票一覧");
|
184
|
+
|
185
|
+
stage.show();
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
}catch(IOException e) {
|
192
|
+
|
193
|
+
e.printStackTrace();
|
194
|
+
|
195
|
+
}
|
196
|
+
|
197
|
+
```
|
198
|
+
|
199
|
+
###コンソール
|
200
|
+
|
201
|
+
```
|
202
|
+
|
203
|
+
Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
|
204
|
+
|
205
|
+
at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1787)
|
206
|
+
|
207
|
+
at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1670)
|
208
|
+
|
209
|
+
at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
|
210
|
+
|
211
|
+
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
|
212
|
+
|
213
|
+
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
|
214
|
+
|
215
|
+
at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
|
216
|
+
|
217
|
+
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
|
218
|
+
|
219
|
+
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
|
220
|
+
|
221
|
+
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
|
222
|
+
|
223
|
+
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
|
224
|
+
|
225
|
+
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
|
226
|
+
|
227
|
+
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
|
228
|
+
|
229
|
+
at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
|
230
|
+
|
231
|
+
at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
|
232
|
+
|
233
|
+
at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
|
234
|
+
|
235
|
+
at javafx.graphics/javafx.scene.Node.fireEvent(Node.java:8879)
|
236
|
+
|
237
|
+
at javafx.controls/javafx.scene.control.ToggleButton.fire(ToggleButton.java:257)
|
238
|
+
|
239
|
+
at javafx.controls/com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:206)
|
240
|
+
|
241
|
+
at javafx.controls/com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
|
242
|
+
|
243
|
+
at javafx.base/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
|
244
|
+
|
245
|
+
at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
|
246
|
+
|
247
|
+
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
|
248
|
+
|
249
|
+
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
|
250
|
+
|
251
|
+
at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
|
252
|
+
|
253
|
+
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
|
254
|
+
|
255
|
+
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
|
256
|
+
|
257
|
+
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
|
258
|
+
|
259
|
+
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
|
260
|
+
|
261
|
+
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
|
262
|
+
|
263
|
+
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
|
264
|
+
|
265
|
+
at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
|
266
|
+
|
267
|
+
at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
|
268
|
+
|
269
|
+
at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
|
270
|
+
|
271
|
+
at javafx.graphics/javafx.scene.Scene$MouseHandler.process(Scene.java:3851)
|
272
|
+
|
273
|
+
at javafx.graphics/javafx.scene.Scene$MouseHandler.access$1200(Scene.java:3579)
|
274
|
+
|
275
|
+
at javafx.graphics/javafx.scene.Scene.processMouseEvent(Scene.java:1849)
|
276
|
+
|
277
|
+
at javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2588)
|
278
|
+
|
279
|
+
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:397)
|
280
|
+
|
281
|
+
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:295)
|
282
|
+
|
283
|
+
at java.base/java.security.AccessController.doPrivileged(Native Method)
|
284
|
+
|
285
|
+
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:434)
|
286
|
+
|
287
|
+
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:390)
|
288
|
+
|
289
|
+
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:433)
|
290
|
+
|
291
|
+
at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(View.java:556)
|
292
|
+
|
293
|
+
at javafx.graphics/com.sun.glass.ui.View.notifyMouse(View.java:942)
|
294
|
+
|
295
|
+
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
|
296
|
+
|
297
|
+
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
|
298
|
+
|
299
|
+
at java.base/java.lang.Thread.run(Thread.java:834)
|
300
|
+
|
301
|
+
Caused by: java.lang.reflect.InvocationTargetException
|
302
|
+
|
303
|
+
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
304
|
+
|
305
|
+
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
|
306
|
+
|
307
|
+
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
308
|
+
|
309
|
+
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
|
310
|
+
|
311
|
+
at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:76)
|
312
|
+
|
313
|
+
at jdk.internal.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
|
314
|
+
|
315
|
+
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
316
|
+
|
317
|
+
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
|
318
|
+
|
319
|
+
at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:273)
|
320
|
+
|
321
|
+
at com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:83)
|
322
|
+
|
323
|
+
at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1782)
|
324
|
+
|
325
|
+
... 47 more
|
326
|
+
|
327
|
+
Caused by: java.lang.ClassCastException: class application.Ndenpyo cannot be cast to class application.KANRIMENUController (application.Ndenpyo and application.KANRIMENUController are in unnamed module of loader 'app')
|
328
|
+
|
329
|
+
at application.KANRIMENUController.On_buttonF2Click(KANRIMENUController.java:97)
|
330
|
+
|
331
|
+
... 58 more
|
332
|
+
|
333
|
+
```
|
2
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -120,7 +120,9 @@
|
|
120
120
|
|
121
121
|
```java
|
122
122
|
|
123
|
+
void On_buttonF2Click(ActionEvent event) {
|
124
|
+
|
123
|
-
|
125
|
+
/*
|
124
126
|
|
125
127
|
* 新しい画面を生成する
|
126
128
|
|
@@ -154,4 +156,6 @@
|
|
154
156
|
|
155
157
|
}
|
156
158
|
|
159
|
+
}
|
160
|
+
|
157
161
|
```
|
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -113,3 +113,45 @@
|
|
113
113
|
・変数で取得したあとの判定と実行のさせかた
|
114
114
|
|
115
115
|
・多数の画面遷移があるのでSceneの部分の追加は都度やらなければいけないのか
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
### 追記
|
120
|
+
|
121
|
+
```java
|
122
|
+
|
123
|
+
/*
|
124
|
+
|
125
|
+
* 新しい画面を生成する
|
126
|
+
|
127
|
+
*/
|
128
|
+
|
129
|
+
try {
|
130
|
+
|
131
|
+
Parent parent = FXMLLoader.load(getClass().getResource("Ndenpyo.fxml"));
|
132
|
+
|
133
|
+
Scene scene = new Scene(parent);
|
134
|
+
|
135
|
+
Stage stage = new Stage();
|
136
|
+
|
137
|
+
KANRIMENUController controller = scene.<KANRIMENUController>getController();
|
138
|
+
|
139
|
+
scene.getAccelerators().put(KeyCodeCombination.valueOf("F2"), () -> controller.buttonF2.fire());
|
140
|
+
|
141
|
+
stage.setScene(scene);
|
142
|
+
|
143
|
+
stage.setTitle("入荷伝票一覧");
|
144
|
+
|
145
|
+
stage.show();
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
}catch(IOException e) {
|
152
|
+
|
153
|
+
e.printStackTrace();
|
154
|
+
|
155
|
+
}
|
156
|
+
|
157
|
+
```
|