diff --git a/src/main/java/Client/view/MessageView.java b/src/main/java/Client/view/MessageView.java index b6a839c1..76bd5392 100644 --- a/src/main/java/Client/view/MessageView.java +++ b/src/main/java/Client/view/MessageView.java @@ -45,8 +45,7 @@ public MessageView(String userName, int id, String message, boolean isPinned, St if (isOwnerMessage) { this.setAlignment(Pos.CENTER_LEFT); this.setStyle("-fx-background-color: #54b74d"); - } - else { + } else { this.setAlignment(Pos.CENTER_RIGHT); this.setStyle("-fx-background-color: #ffff"); } @@ -55,8 +54,8 @@ public MessageView(String userName, int id, String message, boolean isPinned, St optionButton.setOnAction(e -> showOption()); ImageView imageView = null; try { - imageView = new ImageView(new Image(new FileInputStream("src/main/resources/Client/view" + - "/chatButtonImages/options.png"))); + imageView = new ImageView(new Image( + new FileInputStream("src/main/resources/Client/view/chatButtonImages/options.png"))); } catch (FileNotFoundException e) { e.printStackTrace(); } diff --git a/src/main/java/Client/view/ShopCellMenu.java b/src/main/java/Client/view/ShopCellMenu.java index 4020787f..67a93124 100644 --- a/src/main/java/Client/view/ShopCellMenu.java +++ b/src/main/java/Client/view/ShopCellMenu.java @@ -13,6 +13,9 @@ import javafx.scene.text.Text; import Client.view.elements.GetImage; +import java.io.FileInputStream; +import java.io.FileNotFoundException; + public class ShopCellMenu extends AnchorPane { private static ClientShopServer clientShopServer; private ShopMenuGui shopMenuGui; @@ -63,8 +66,7 @@ public void setButton() { if (clientShopServer.getUserMoney() >= price) { buyButton.setText("buy"); buyButton.setStyle("-fx-background-color: #0000ff"); - } - else { + } else { buyButton.setText("_"); buyButton.setStyle("-fx-background-color: orange"); } @@ -74,8 +76,7 @@ public void setButton() { if (clientShopServer.getUserMoney() >= price) { buyButton.setText("buy"); buyButton.setStyle("-fx-background-color: #0000ff"); - } - else { + } else { buyButton.setText("_"); buyButton.setStyle("-fx-background-color: orange"); } @@ -92,10 +93,15 @@ public void setButton() { } private void setImageButton(Button buyButton) { - ImageView imageView = new ImageView(new Image("src\\main\\resources\\Client\\view\\chatButtonImages\\forbidden.png")); - imageView.setFitWidth(19); - imageView.setFitHeight(17); - buyButton.setGraphic(imageView); + try { + ImageView imageView = new ImageView(new Image( + new FileInputStream("src\\main\\resources\\Client\\view\\chatButtonImages\\forbidden.png"))); + imageView.setFitWidth(19); + imageView.setFitHeight(17); + buyButton.setGraphic(imageView); + } catch (FileNotFoundException fileNotFoundException) { + fileNotFoundException.printStackTrace(); + } } public void setCardText() {