回答編集履歴

1

サンプル追記

2020/12/16 09:57

投稿

TN8001
TN8001

スコア9357

test CHANGED
@@ -265,3 +265,55 @@
265
265
 
266
266
 
267
267
  ![アプリ画像](90826284e19cd96e15423e0a45d2034b.png)
268
+
269
+
270
+
271
+ ---
272
+
273
+
274
+
275
+ サンプル追記
276
+
277
+ ```Java
278
+
279
+ static class Message extends JPanel {
280
+
281
+ public Message(String message, ImageIcon icon, FlowLayout layout) {
282
+
283
+ setLayout(layout);
284
+
285
+ setBackground(Color.WHITE);
286
+
287
+
288
+
289
+ JPanel panel = new JPanel();
290
+
291
+ panel.add(new JLabel(icon));
292
+
293
+
294
+
295
+ JPanel p1 = new JPanel();
296
+
297
+ // 雑い フォントサイズによりずれると思われる
298
+
299
+ p1.setPreferredSize(new Dimension(170,70));
300
+
301
+ p1.add(new JButton("\uD83D\uDE00"));
302
+
303
+ p1.add(new JButton("\uD83D\uDE11"));
304
+
305
+ p1.add(new JButton("\uD83D\uDE0D"));
306
+
307
+ p1.add(new JButton("保存"));
308
+
309
+
310
+
311
+ panel.add(p1);
312
+
313
+ add(panel);
314
+
315
+ }
316
+
317
+ }
318
+
319
+ ```