diff --git a/src/main/java/ruscz/game/gameOfProd/Dialog/Dialog.java b/src/main/java/ruscz/game/gameOfProd/Dialog/Dialog.java index 69fb500..9f40970 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.red); + text.setForeground(Color.yellow); text.setVisible(true); Dimension size = text.getPreferredSize(); diff --git a/src/main/java/ruscz/game/gameOfProd/Dialog/DialogBar.java b/src/main/java/ruscz/game/gameOfProd/Dialog/DialogBar.java index d815409..b9773b5 100644 --- a/src/main/java/ruscz/game/gameOfProd/Dialog/DialogBar.java +++ b/src/main/java/ruscz/game/gameOfProd/Dialog/DialogBar.java @@ -1,6 +1,7 @@ package ruscz.game.gameOfProd.Dialog; import ruscz.game.gameOfProd.Image.ImageDialog; +import ruscz.game.gameOfProd.Windows.WindowOfFreeMove; import javax.swing.*; import java.awt.*; @@ -19,8 +20,10 @@ public class DialogBar extends JPanel { @Override public void paint(Graphics g) { super.paint(g); + ImageDialog.parseBackground(); + g.drawImage(ImageDialog.getDialogBack(), 0, 0, WindowOfFreeMove.CELL_SIZE * WindowOfFreeMove.WINDOW_WIDTH, WindowOfFreeMove.CELL_SIZE * WindowOfFreeMove.WINDOW_HEIGHT / 4, this); if (imageDialog != null){ - g.drawImage(imageDialog.getImage(), 0, 0, this); + g.drawImage(imageDialog.getImage(), 10, 10, 91,91, this); } } } diff --git a/src/main/java/ruscz/game/gameOfProd/Image/ImageDialog.java b/src/main/java/ruscz/game/gameOfProd/Image/ImageDialog.java index c7a7d6d..f21a6f4 100644 --- a/src/main/java/ruscz/game/gameOfProd/Image/ImageDialog.java +++ b/src/main/java/ruscz/game/gameOfProd/Image/ImageDialog.java @@ -8,16 +8,27 @@ import java.io.IOException; public class ImageDialog { private String name; private Image image; + private static Image dialogBack; public Image getImage() { return image; } + public static Image getDialogBack() {return dialogBack;} + public ImageDialog(String name){ this.name = name; parseImage(); } + public static void parseBackground() { + try { + dialogBack = ImageIO.read(new File("src/main/resources/DialogBox.png")); + } catch (IOException e) { + e.printStackTrace(); + } + } + private void parseImage(){ try { image = ImageIO.read(new File("src/main/resources/" + name)); @@ -27,4 +38,6 @@ public class ImageDialog { } + + } diff --git a/src/main/resources/DialogBox.png b/src/main/resources/DialogBox.png new file mode 100644 index 0000000..bade1ae Binary files /dev/null and b/src/main/resources/DialogBox.png differ