From 16396b23239f9f0cb68bc514c692e6891fbc27c0 Mon Sep 17 00:00:00 2001 From: iryupnik Date: Sun, 29 Mar 2020 20:08:41 +0200 Subject: [PATCH] Transparent Dialog --- src/main/java/ruscz/game/gameOfProd/Dialog/Dialog.java | 3 ++- .../java/ruscz/game/gameOfProd/Windows/WindowOfFreeMove.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/ruscz/game/gameOfProd/Dialog/Dialog.java b/src/main/java/ruscz/game/gameOfProd/Dialog/Dialog.java index 9f40970..19c9705 100644 --- a/src/main/java/ruscz/game/gameOfProd/Dialog/Dialog.java +++ b/src/main/java/ruscz/game/gameOfProd/Dialog/Dialog.java @@ -43,7 +43,7 @@ public class Dialog { JLabel text = new JLabel(); text.setText(string); text.setFont(f1); - text.setForeground(Color.yellow); + text.setForeground(Color.BLUE.darker().darker().darker().darker().darker().darker().darker().darker().darker().darker().darker().darker()); text.setVisible(true); Dimension size = text.getPreferredSize(); @@ -67,6 +67,7 @@ public class Dialog { if (dialogBar.getComponentCount() != 0) dialogBar.remove(0); dialogBar.add(textToShow); + dialogBar.revalidate(); charNumber++; if (charNumber == textLength) { timer.stop(); diff --git a/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfFreeMove.java b/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfFreeMove.java index c0d1b44..34be5e5 100644 --- a/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfFreeMove.java +++ b/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfFreeMove.java @@ -90,7 +90,7 @@ public class WindowOfFreeMove extends JFrame { dialogBar = new DialogBar(); dialogBar.setBounds(0, WindowOfFreeMove.CELL_SIZE * WindowOfFreeMove.WINDOW_HEIGHT * 3 / 4, WindowOfFreeMove.CELL_SIZE * WindowOfFreeMove.WINDOW_WIDTH, WindowOfFreeMove.CELL_SIZE * WindowOfFreeMove.WINDOW_HEIGHT / 4); - dialogBar.setBackground(Color.BLACK); + dialogBar.setOpaque(false); dialogBar.setVisible(false); dialogBar.setLayout(null);