Skip to content

Commit c111f4f

Browse files
author
Pablo Fernandez
authored
Merge pull request #3 from WhitmanSWDesignSpring2017/MyStuffRightNow
Dialogue Box
2 parents 442756f + a8cad18 commit c111f4f

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/scaleplayer/ScalePlayer.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
import javafx.stage.Stage;
1515
import javafx.scene.layout.*;
1616
import javafx.scene.control.*;
17+
import javafx.*;
18+
import java.util.*;
19+
1720

1821
/**
1922
* This JavaFX app lets the user play scales.
@@ -24,6 +27,8 @@
2427

2528
public class ScalePlayer extends Application {
2629

30+
private static int startingNote;
31+
2732
@Override
2833
public void start(Stage primaryStage) {
2934

@@ -42,7 +47,18 @@ public void start(Stage primaryStage) {
4247

4348
@Override
4449
public void handle(ActionEvent event) {
45-
System.out.println("Hello World!");
50+
TextInputDialog dialog = new TextInputDialog();
51+
dialog.setTitle("Starting Note");
52+
dialog.setHeaderText("Please enter a note (0-155)");
53+
54+
Optional<String> result = dialog.showAndWait();
55+
if (result.isPresent()){
56+
System.out.println("Entered Note: " + result.toString());
57+
String stringResult = result.toString();
58+
stringResult = stringResult.substring(9, stringResult.length()-1);
59+
startingNote = Integer.parseInt(stringResult);
60+
//playScale(startingNote);
61+
}
4662
}
4763
});
4864

0 commit comments

Comments
 (0)