質問編集履歴
1
コード部分をteratail様式に変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -134,6 +134,8 @@
|
|
134
134
|
|
135
135
|
---
|
136
136
|
|
137
|
+
```ここに言語を入力
|
138
|
+
|
137
139
|
package fxmlexample;
|
138
140
|
|
139
141
|
|
@@ -180,236 +182,252 @@
|
|
180
182
|
|
181
183
|
}
|
182
184
|
|
185
|
+
|
186
|
+
|
187
|
+
```
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
FXMLExampleController.java
|
192
|
+
|
183
193
|
---
|
184
194
|
|
185
|
-
|
195
|
+
```ここに言語を入力
|
196
|
+
|
186
|
-
|
197
|
+
package fxmlexample;
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
import javafx.event.ActionEvent;
|
202
|
+
|
203
|
+
import javafx.fxml.FXML;
|
204
|
+
|
205
|
+
import javafx.scene.text.Text;
|
206
|
+
|
207
|
+
|
208
|
+
|
187
|
-
FXMLExampleController
|
209
|
+
public class FXMLExampleController {
|
210
|
+
|
211
|
+
@FXML private Text actiontarget;
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
@FXML protected void handleSubmitButtonAction(ActionEvent event) {
|
216
|
+
|
217
|
+
actiontarget.setText("Sign in button pressed");
|
218
|
+
|
219
|
+
}
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
}
|
224
|
+
|
225
|
+
```
|
226
|
+
|
227
|
+
|
188
228
|
|
189
229
|
---
|
190
230
|
|
231
|
+
|
232
|
+
|
233
|
+
module-info.java
|
234
|
+
|
235
|
+
```ここに言語を入力
|
236
|
+
|
237
|
+
module fxmlexample{
|
238
|
+
|
191
|
-
p
|
239
|
+
exports fxmlexample;
|
240
|
+
|
192
|
-
|
241
|
+
requires javafx.graphics;
|
242
|
+
|
193
|
-
|
243
|
+
requires javafx.controls;
|
244
|
+
|
194
|
-
|
245
|
+
requires javafx.fxml;
|
246
|
+
|
247
|
+
}
|
248
|
+
|
249
|
+
```
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
fxml_example.fxml
|
254
|
+
|
255
|
+
----
|
256
|
+
|
257
|
+
```ここに言語を入力
|
258
|
+
|
259
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
<?import java.net.*?>
|
264
|
+
|
265
|
+
<?import javafx.geometry.*?>
|
266
|
+
|
195
|
-
import javafx.e
|
267
|
+
<?import javafx.scene.control.*?>
|
196
|
-
|
268
|
+
|
197
|
-
import javafx.
|
269
|
+
<?import javafx.scene.layout.*?>
|
198
|
-
|
270
|
+
|
199
|
-
import javafx.scene.text.
|
271
|
+
<?import javafx.scene.text.*?>
|
200
|
-
|
201
|
-
|
202
|
-
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
|
203
|
-
|
277
|
+
<GridPane fx:controller="FXMLExampleController"
|
278
|
+
|
204
|
-
|
279
|
+
xmlns:fx="http://javafx.com/fxml"
|
280
|
+
|
281
|
+
alignment="center" hgap="10" vgap="10"
|
282
|
+
|
205
|
-
|
283
|
+
styleClass="root">
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
<padding>
|
288
|
+
|
289
|
+
<Insets top="25" right="25" bottom="25" left="25"/>
|
290
|
+
|
291
|
+
</padding>
|
206
292
|
|
207
293
|
|
208
294
|
|
209
|
-
|
295
|
+
<Text id="welcome-text" text="Welcome"
|
296
|
+
|
210
|
-
|
297
|
+
GridPane.columnIndex="0" GridPane.rowIndex="0"
|
298
|
+
|
299
|
+
GridPane.columnSpan="2"/>
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
<Label text="User Name:"
|
304
|
+
|
305
|
+
GridPane.columnIndex="0" GridPane.rowIndex="1"/>
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
<TextField GridPane.columnIndex="1" GridPane.rowIndex="1"/>
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
<Label text="Password:"
|
314
|
+
|
315
|
+
GridPane.columnIndex="0" GridPane.rowIndex="2"/>
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
<PasswordField fx:id="passwordField"
|
320
|
+
|
321
|
+
GridPane.columnIndex="1" GridPane.rowIndex="2"/>
|
322
|
+
|
323
|
+
|
324
|
+
|
211
|
-
|
325
|
+
<HBox spacing="10" alignment="bottom_right"
|
326
|
+
|
212
|
-
|
327
|
+
GridPane.columnIndex="1" GridPane.rowIndex="4">
|
328
|
+
|
329
|
+
<Button text="Sign In" onAction="#handleSubmitButtonAction"/>
|
330
|
+
|
331
|
+
</HBox>
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
<Text fx:id="actiontarget"
|
336
|
+
|
337
|
+
GridPane.columnIndex="1" GridPane.rowIndex="6"/>
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
<stylesheets>
|
342
|
+
|
343
|
+
<URL value="@Login.css" />
|
344
|
+
|
345
|
+
</stylesheets>
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
</GridPane>
|
350
|
+
|
213
|
-
|
351
|
+
```
|
214
|
-
|
215
|
-
|
216
|
-
|
352
|
+
|
353
|
+
|
354
|
+
|
217
|
-
|
355
|
+
Login.css
|
218
356
|
|
219
357
|
---
|
220
358
|
|
221
|
-
|
359
|
+
```ここに言語を入力
|
360
|
+
|
222
|
-
|
361
|
+
root {
|
362
|
+
|
223
|
-
|
363
|
+
display: block;
|
364
|
+
|
365
|
+
}
|
366
|
+
|
367
|
+
.root {
|
368
|
+
|
369
|
+
-fx-background-image: url("background.jpg");
|
370
|
+
|
371
|
+
}
|
372
|
+
|
373
|
+
.label {
|
374
|
+
|
375
|
+
-fx-font-size: 12px;
|
376
|
+
|
377
|
+
-fx-font-weight: bold;
|
378
|
+
|
379
|
+
-fx-text-fill: #333333;
|
380
|
+
|
381
|
+
-fx-effect: dropshadow( gaussian , rgba(255,255,255,0.5) , 0,0,0,1 );
|
382
|
+
|
383
|
+
}
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
#welcome-text {
|
388
|
+
|
389
|
+
-fx-font-size: 32px;
|
390
|
+
|
391
|
+
-fx-font-family: "Arial Black";
|
392
|
+
|
393
|
+
-fx-fill: #818181;
|
394
|
+
|
395
|
+
-fx-effect: innershadow( three-pass-box , rgba(0,0,0,0.7) , 6, 0.0 , 0 , 2 );
|
396
|
+
|
397
|
+
}
|
398
|
+
|
399
|
+
#actiontarget {
|
400
|
+
|
401
|
+
-fx-fill: FIREBRICK;
|
402
|
+
|
403
|
+
-fx-font-weight: bold;
|
404
|
+
|
405
|
+
-fx-effect: dropshadow( gaussian , rgba(255,255,255,0.5) , 0,0,0,1 );
|
406
|
+
|
407
|
+
}
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
.button {
|
412
|
+
|
413
|
+
-fx-text-fill: white;
|
414
|
+
|
415
|
+
-fx-font-family: "Arial Narrow";
|
416
|
+
|
417
|
+
-fx-font-weight: bold;
|
418
|
+
|
419
|
+
-fx-background-color: linear-gradient(#61a2b1, #2A5058);
|
420
|
+
|
421
|
+
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 5, 0.0 , 0 , 1 );
|
422
|
+
|
423
|
+
}
|
424
|
+
|
425
|
+
```
|
426
|
+
|
427
|
+
|
224
428
|
|
225
429
|
---
|
226
430
|
|
227
|
-
module fxmlexample{
|
228
|
-
|
229
|
-
exports fxmlexample;
|
230
|
-
|
231
|
-
requires javafx.graphics;
|
232
|
-
|
233
|
-
requires javafx.controls;
|
234
|
-
|
235
|
-
requires javafx.fxml;
|
236
|
-
|
237
|
-
}
|
238
|
-
|
239
|
-
----
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
fxml_example.fxml
|
244
|
-
|
245
|
-
----
|
246
|
-
|
247
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
<?import java.net.*?>
|
252
|
-
|
253
|
-
<?import javafx.geometry.*?>
|
254
|
-
|
255
|
-
<?import javafx.scene.control.*?>
|
256
|
-
|
257
|
-
<?import javafx.scene.layout.*?>
|
258
|
-
|
259
|
-
<?import javafx.scene.text.*?>
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
<GridPane fx:controller="FXMLExampleController"
|
266
|
-
|
267
|
-
xmlns:fx="http://javafx.com/fxml"
|
268
|
-
|
269
|
-
alignment="center" hgap="10" vgap="10"
|
270
|
-
|
271
|
-
styleClass="root">
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
<padding>
|
276
|
-
|
277
|
-
<Insets top="25" right="25" bottom="25" left="25"/>
|
278
|
-
|
279
|
-
</padding>
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
<Text id="welcome-text" text="Welcome"
|
284
|
-
|
285
|
-
GridPane.columnIndex="0" GridPane.rowIndex="0"
|
286
|
-
|
287
|
-
GridPane.columnSpan="2"/>
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
<Label text="User Name:"
|
292
|
-
|
293
|
-
GridPane.columnIndex="0" GridPane.rowIndex="1"/>
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
<TextField GridPane.columnIndex="1" GridPane.rowIndex="1"/>
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
<Label text="Password:"
|
302
|
-
|
303
|
-
GridPane.columnIndex="0" GridPane.rowIndex="2"/>
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
<PasswordField fx:id="passwordField"
|
308
|
-
|
309
|
-
GridPane.columnIndex="1" GridPane.rowIndex="2"/>
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
<HBox spacing="10" alignment="bottom_right"
|
314
|
-
|
315
|
-
GridPane.columnIndex="1" GridPane.rowIndex="4">
|
316
|
-
|
317
|
-
<Button text="Sign In" onAction="#handleSubmitButtonAction"/>
|
318
|
-
|
319
|
-
</HBox>
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
<Text fx:id="actiontarget"
|
324
|
-
|
325
|
-
GridPane.columnIndex="1" GridPane.rowIndex="6"/>
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
<stylesheets>
|
330
|
-
|
331
|
-
<URL value="@Login.css" />
|
332
|
-
|
333
|
-
</stylesheets>
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
</GridPane>
|
338
|
-
|
339
|
-
---
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
Login.css
|
344
|
-
|
345
|
-
---
|
346
|
-
|
347
|
-
root {
|
348
|
-
|
349
|
-
display: block;
|
350
|
-
|
351
|
-
}
|
352
|
-
|
353
|
-
.root {
|
354
|
-
|
355
|
-
-fx-background-image: url("background.jpg");
|
356
|
-
|
357
|
-
}
|
358
|
-
|
359
|
-
.label {
|
360
|
-
|
361
|
-
-fx-font-size: 12px;
|
362
|
-
|
363
|
-
-fx-font-weight: bold;
|
364
|
-
|
365
|
-
-fx-text-fill: #333333;
|
366
|
-
|
367
|
-
-fx-effect: dropshadow( gaussian , rgba(255,255,255,0.5) , 0,0,0,1 );
|
368
|
-
|
369
|
-
}
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
#welcome-text {
|
374
|
-
|
375
|
-
-fx-font-size: 32px;
|
376
|
-
|
377
|
-
-fx-font-family: "Arial Black";
|
378
|
-
|
379
|
-
-fx-fill: #818181;
|
380
|
-
|
381
|
-
-fx-effect: innershadow( three-pass-box , rgba(0,0,0,0.7) , 6, 0.0 , 0 , 2 );
|
382
|
-
|
383
|
-
}
|
384
|
-
|
385
|
-
#actiontarget {
|
386
|
-
|
387
|
-
-fx-fill: FIREBRICK;
|
388
|
-
|
389
|
-
-fx-font-weight: bold;
|
390
|
-
|
391
|
-
-fx-effect: dropshadow( gaussian , rgba(255,255,255,0.5) , 0,0,0,1 );
|
392
|
-
|
393
|
-
}
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
.button {
|
398
|
-
|
399
|
-
-fx-text-fill: white;
|
400
|
-
|
401
|
-
-fx-font-family: "Arial Narrow";
|
402
|
-
|
403
|
-
-fx-font-weight: bold;
|
404
|
-
|
405
|
-
-fx-background-color: linear-gradient(#61a2b1, #2A5058);
|
406
|
-
|
407
|
-
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 5, 0.0 , 0 , 1 );
|
408
|
-
|
409
|
-
}
|
410
|
-
|
411
|
-
---
|
412
|
-
|
413
431
|
|
414
432
|
|
415
433
|
### 試したこと
|