Skip to content

Commit

Permalink
Update window name to reflect which model # it is
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuber03 committed Jul 28, 2023
1 parent 2614589 commit be8f265
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

public class MainController {

private static Stage newWindow;
private static Stage newWindow; // to pass into NewTableSceneController

public static int newWindowCount = 0; // to track amount of new windows made

/**
* Getter method to access the newWindow from other files.
Expand Down Expand Up @@ -44,6 +46,7 @@ public void handleButtonAction(ActionEvent event) throws IOException {


public void handleMenuNewFileClick() throws IOException {
newWindowCount++;
// Set up secondary window
FXMLLoader loader = new FXMLLoader(getClass().getResource("../view/NewTableScene.fxml"));
Parent secondaryLayout = loader.load();
Expand Down Expand Up @@ -74,6 +77,8 @@ public void handleMenuNewFileClick() throws IOException {
* window.
*/
public void openSecondaryWindow(Event event, Boolean fromButton) throws IOException {
newWindowCount++;

// Set up secondary window
FXMLLoader loader = new FXMLLoader(getClass().getResource("../view/NewTableScene.fxml"));
Parent secondaryLayout = loader.load();
Expand All @@ -84,7 +89,7 @@ public void openSecondaryWindow(Event event, Boolean fromButton) throws IOExcept
newWindow = new Stage();
Image icon = new Image(getClass().getResource("../resources/icon.png").toExternalForm());

Main.setStageIconAndTitle(newWindow, "Model 1", icon);
Main.setStageIconAndTitle(newWindow, "Model " + newWindowCount, icon);


// Load in primary window
Expand Down

0 comments on commit be8f265

Please sign in to comment.