aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2023-05-14 01:46:56 -0400
committersowgro <tpoke.ferrari@gmail.com>2023-05-14 01:46:56 -0400
commit9568ea5118b9100b3375a6bd2153042506b0d5d1 (patch)
tree0e8ea5d267677bfc914b52ced330022ecd7efce9 /src/main
parent054ff93a8e5bf51988f0324619ae4c95249f9556 (diff)
downloadNPEhero-9568ea5118b9100b3375a6bd2153042506b0d5d1.tar.gz
NPEhero-9568ea5118b9100b3375a6bd2153042506b0d5d1.tar.bz2
NPEhero-9568ea5118b9100b3375a6bd2153042506b0d5d1.zip
Finish css and menus
Diffstat (limited to 'src/main')
-rw-r--r--src/main/JFXaudioPlayer.java17
-rw-r--r--src/main/focusTest.java46
2 files changed, 61 insertions, 2 deletions
diff --git a/src/main/JFXaudioPlayer.java b/src/main/JFXaudioPlayer.java
index 0a2162d..9207c59 100644
--- a/src/main/JFXaudioPlayer.java
+++ b/src/main/JFXaudioPlayer.java
@@ -1,16 +1,29 @@
package main;
import java.io.File;
+import java.io.IOException;
+
+import javafx.application.Application;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Parent;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
+import javafx.stage.Stage;
-public class JFXaudioPlayer {
+public class JFXaudioPlayer extends Application{
+
public static void main(String[] args)
{
+ launch(args);
+ }
+
+ @Override
+ public void start(Stage primaryStage)
+ {
+ // primaryStage.show();
String musicFile = "EXAMPLE.mp3"; // For example
Media sound = new Media(new File(musicFile).toURI().toString());
MediaPlayer mediaPlayer = new MediaPlayer(sound);
mediaPlayer.play();
- mediaPlayer.stop();
}
} \ No newline at end of file
diff --git a/src/main/focusTest.java b/src/main/focusTest.java
new file mode 100644
index 0000000..28e61a3
--- /dev/null
+++ b/src/main/focusTest.java
@@ -0,0 +1,46 @@
+package main;
+
+import javafx.application.Application;
+import javafx.geometry.Pos;
+import javafx.scene.Scene;
+import javafx.scene.control.ToggleButton;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.VBox;
+import javafx.stage.Stage;
+
+public class focusTest extends Application {
+
+ public static void main(String[] args)
+ {
+ launch(args);
+ }
+
+ @Override
+ public void start(Stage primaryStage) throws Exception
+ {
+ VBox root = new VBox();
+ root.setAlignment(Pos.CENTER);
+ root.setSpacing(20);
+ Scene sc = new Scene(root, 500, 500);
+ primaryStage.setScene(sc);
+ primaryStage.show();
+
+
+ ToggleButton btn1 = new ToggleButton("Button 1");
+ ToggleButton btn2 = new ToggleButton("Button 2");
+ ToggleButton btn3 = new ToggleButton("Button 3");
+ ToggleButton btn4 = new ToggleButton("Button 4");
+
+ HBox hb1 = new HBox();
+ hb1.setAlignment(Pos.CENTER);
+ hb1.getChildren().addAll(btn1, btn2);
+
+ HBox hb2 = new HBox();
+ hb2.setAlignment(Pos.CENTER);
+ hb2.getChildren().addAll(btn3, btn4);
+
+ root.getChildren().addAll(hb1, hb2);
+
+ hb1.requestFocus();
+ }
+}