File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 1414import javafx .stage .Stage ;
1515import javafx .scene .layout .*;
1616import javafx .scene .control .*;
17+ import javafx .*;
18+ import java .util .*;
19+
1720
1821/**
1922 * This JavaFX app lets the user play scales.
2427
2528public 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
You can’t perform that action at this time.
0 commit comments