Transparent Dialog

This commit is contained in:
iryupnik 2020-03-29 20:08:41 +02:00
parent 5e077ea186
commit 16396b2323
2 changed files with 3 additions and 2 deletions

View File

@ -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();

View File

@ -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);