回答編集履歴
2
追加
test
CHANGED
@@ -27,3 +27,7 @@
|
|
27
27
|
mainFrame.setVisible(true);
|
28
28
|
|
29
29
|
```
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
[こちらはどうでしょうか?](https://codeday.me/jp/qa/20190301/343651.html)
|
1
追加
test
CHANGED
@@ -1,3 +1,29 @@
|
|
1
1
|
背景画像に該当画像を設定されてみては?
|
2
2
|
|
3
3
|
[参考サイト](https://teratail.com/questions/170834)
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
一応引用しておきます。
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
> ```Java
|
12
|
+
|
13
|
+
import javax.swing.*;
|
14
|
+
|
15
|
+
JFrame mainFrame = new JFrame("サンプル");
|
16
|
+
|
17
|
+
mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
18
|
+
|
19
|
+
mainFrame.setSize(320, 160);
|
20
|
+
|
21
|
+
mainFrame.setLocationRelativeTo(null);
|
22
|
+
|
23
|
+
JLabel background = new JLabel(new ImageIcon("画像パス"));
|
24
|
+
|
25
|
+
mainFrame.add(background);
|
26
|
+
|
27
|
+
mainFrame.setVisible(true);
|
28
|
+
|
29
|
+
```
|