From ea4be8a1e1e56b71e28aee00a853f77268be4678 Mon Sep 17 00:00:00 2001 From: Valentin Spiroski Date: Fri, 9 Feb 2024 21:38:21 +0100 Subject: [PATCH] JDialog in showEmojiPicker() --- src/main/java/ChatClient.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/ChatClient.java b/src/main/java/ChatClient.java index b19c6a0..6a3e773 100644 --- a/src/main/java/ChatClient.java +++ b/src/main/java/ChatClient.java @@ -142,7 +142,12 @@ public class ChatClient extends JFrame implements KeyListener { } private void showEmojiPicker() { - + JDialog emojiDialog = new JDialog(this, "Emoji Picker", true); + emojiDialog.setDefaultCloseOperation(DISPOSE_ON_CLOSE); + emojiDialog.getContentPane().add(emojiPicker); + emojiDialog.pack(); + emojiDialog.setLocationRelativeTo(this); + emojiDialog.setVisible(true); }