diff --git a/src/main/java/sbu/javafx/Launcher.java b/src/main/java/sbu/javafx/Launcher.java index c288d10..6351bdc 100644 --- a/src/main/java/sbu/javafx/Launcher.java +++ b/src/main/java/sbu/javafx/Launcher.java @@ -2,7 +2,10 @@ package sbu.javafx; import javafx.application.Application; -public class Launcher{ - public static void main(String[] args) { - // TODO: Launch the JavaFX application by calling Application.launch(Main.class) } -} +public class Launcher +{ + public static void main(String[] args) + { + Application.launch(MusicApp.class, args); + } +} \ No newline at end of file diff --git a/src/main/java/sbu/javafx/MusicApp.java b/src/main/java/sbu/javafx/MusicApp.java index a50badc..966c11e 100644 --- a/src/main/java/sbu/javafx/MusicApp.java +++ b/src/main/java/sbu/javafx/MusicApp.java @@ -4,7 +4,6 @@ import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Scene; import javafx.stage.Stage; - import java.io.IOException; public class MusicApp extends Application { @@ -12,12 +11,12 @@ public class MusicApp extends Application { @Override public void start(Stage stage) throws IOException { - FXMLLoader fxmlLoader = new FXMLLoader(MusicApp.class.getResource("App-view.fxml")); - Scene scene = new Scene(fxmlLoader.load()); + FXMLLoader loader = new FXMLLoader(MusicApp.class.getResource("App-view.fxml")); + Scene scene = new Scene(loader.load(), 1280, 900); + stage.setTitle("Music Player"); stage.setScene(scene); - //TODO: add icon to the stage + stage.setResizable(false); stage.show(); } - } diff --git a/src/main/java/sbu/javafx/MusicController.java b/src/main/java/sbu/javafx/MusicController.java index 5da27a9..aba31df 100644 --- a/src/main/java/sbu/javafx/MusicController.java +++ b/src/main/java/sbu/javafx/MusicController.java @@ -1,31 +1,237 @@ package sbu.javafx; import javafx.fxml.FXML; -import javafx.event.ActionEvent; +import javafx.fxml.FXMLLoader; +import javafx.scene.Scene; +import javafx.scene.control.Button; import javafx.scene.control.Label; -import javafx.scene.input.MouseEvent; -import javafx.scene.layout.VBox; +import javafx.scene.control.ToggleButton; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.Pane; +import javafx.stage.Stage; +import java.io.IOException; +import java.util.ArrayList; public class MusicController { - // TODO: Define your UI components using the @FXML annotation. + @FXML private Label nowPlayingLabel; + @FXML private GridPane songsGrid; + @FXML private ToggleButton themeToggle; - //TODO: Implement the logic to play a song. This method should update the UI to show which song is currently playing. + @FXML private Label song1Title; + @FXML private Label song1Artist; + @FXML private Label song1Duration; + + @FXML private Label song2Title; + @FXML private Label song2Artist; + @FXML private Label song2Duration; + + @FXML private Label song3Title; + @FXML private Label song3Artist; + @FXML private Label song3Duration; + + @FXML private Button playBtn1; + @FXML private Button playBtn2; + @FXML private Button playBtn3; + + + private final ArrayList playlist = new ArrayList<>(); + private final ArrayList