Skip to content

Commit

Permalink
added JMetro style to alert windows + added tutorial under "help -> g…
Browse files Browse the repository at this point in the history
…etting started"
  • Loading branch information
Sten Laane committed Mar 22, 2019
1 parent 06969a0 commit 13fbc2b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/main/java/stocktracker/StockTracker.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import java.util.ArrayList;
import java.util.List;

//TODO: Add javadoc comments
//TODO: migrate files to .csv format?
//TODO: Add unit testing
//TODO: Delete temp files when done with them (File.createTempFile()?)
Expand Down
11 changes: 9 additions & 2 deletions src/main/java/stocktracker/StockTrackerGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,24 @@ private void setupMenuBar(Pane parent) {

alert.setTitle("About StockTracker");
alert.setHeaderText(null); // Alerts have an optional header.
alert.setContentText("Author: Sten Laane\nVersion: " + StockTracker.VERSION);
alert.setContentText("Author: Sten Arthur Laane\nVersion: " + StockTracker.VERSION);
new JMetro(JMetro.Style.LIGHT).applyTheme(stage.getScene());
alert.showAndWait();});

MenuItem howToUseItem = new MenuItem("Getting started");
howToUseItem.setOnAction(event -> {
Alert alert = new Alert(Alert.AlertType.INFORMATION);
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
stage.getIcons().add(new Image("icon.png"));

alert.setHeaderText(null); // Alerts have an optional header.
alert.setTitle("How to use StockTracker");
alert.setContentText("***Insert tutorial here***");
alert.setContentText("1. Press 'New Tracker'\n2. Choose the date you wish to start" +
" tracking the stocks from\n3. Write down the stock you wish to track " +
"and what currency it's traded in (e.g. AAPL_USD) in the ticker_currency field. " +
"Write how much of that stock you own in the amount field." +
"\n4. Press 'Go!'");
new JMetro(JMetro.Style.LIGHT).applyTheme(stage.getScene());
alert.showAndWait();});
helpMenu.getItems().addAll(aboutItem, howToUseItem);

Expand Down

0 comments on commit 13fbc2b

Please sign in to comment.