Skip to content

Commit

Permalink
Small UI tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikollai committed May 25, 2026
1 parent d3a095f commit 381a64d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
39 changes: 19 additions & 20 deletions src/main/java/millions/view/GameView.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,27 +173,26 @@ protected void updateItem(String profit, boolean empty) {
});
TableColumn<Share, Share> marketColumn = new TableColumn<>("Market");
marketColumn.setMinWidth(100);
marketColumn.setCellFactory(column -> {
return new TableCell<Share, Share>() {
private final Button button = new Button("Market Page");

@Override
protected void updateItem(Share share, boolean empty) {
super.updateItem(share, empty);

if (empty) {
setGraphic(null);
} else {
button.setOnAction(event -> {
Share s = getTableView().getItems().get(getIndex());
getTabPane().getSelectionModel().select(0);
stocksList.getSelectionModel().select(s.getStock());
showStockChart(s.getStock());
});
setGraphic(button);
}
marketColumn.setStyle("-fx-alignment: CENTER;");
marketColumn.setCellFactory(column -> new TableCell<Share, Share>() {
private final Button button = new Button("Market Page");

@Override
protected void updateItem(Share share, boolean empty) {
super.updateItem(share, empty);

if (empty) {
setGraphic(null);
} else {
button.setOnAction(event -> {
Share s = getTableView().getItems().get(getIndex());
getTabPane().getSelectionModel().select(0);
stocksList.getSelectionModel().select(s.getStock());
showStockChart(s.getStock());
});
setGraphic(button);
}
};
}
});
portfolioTable
.getColumns()
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/millions/view/StartView.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public StartView(Stage stage) {
setSpacing(12);
setPadding(new Insets(40));

Label infoField = new Label("Select stock file, or use default");
Label infoField = new Label("Select stock file, or press start to use default configuration");
// infoField.setMaxWidth(250);

nameField = new TextField("user");
Expand Down

0 comments on commit 381a64d

Please sign in to comment.