diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/sbu/javafx/Launcher.java b/src/main/java/sbu/javafx/Launcher.java
index c288d10..99c1d1d 100644
--- a/src/main/java/sbu/javafx/Launcher.java
+++ b/src/main/java/sbu/javafx/Launcher.java
@@ -2,7 +2,9 @@ package sbu.javafx;
import javafx.application.Application;
-public class Launcher{
+public class Launcher {
public static void main(String[] args) {
- // TODO: Launch the JavaFX application by calling Application.launch(Main.class) }
+ // TODO: Launch the JavaFX application by calling Application.launch(Main.class)
+ Application.launch(MusicApp.class);
+ }
}
diff --git a/src/main/java/sbu/javafx/MusicApp.java b/src/main/java/sbu/javafx/MusicApp.java
index a50badc..914b71b 100644
--- a/src/main/java/sbu/javafx/MusicApp.java
+++ b/src/main/java/sbu/javafx/MusicApp.java
@@ -13,7 +13,7 @@ public class MusicApp extends Application {
public void start(Stage stage) throws IOException
{
FXMLLoader fxmlLoader = new FXMLLoader(MusicApp.class.getResource("App-view.fxml"));
- Scene scene = new Scene(fxmlLoader.load());
+ Scene scene = new Scene(fxmlLoader.load(), 800, 800);
stage.setTitle("Music Player");
stage.setScene(scene);
//TODO: add icon to the stage
diff --git a/src/main/java/sbu/javafx/MusicController.java b/src/main/java/sbu/javafx/MusicController.java
index 5da27a9..3af4a57 100644
--- a/src/main/java/sbu/javafx/MusicController.java
+++ b/src/main/java/sbu/javafx/MusicController.java
@@ -1,31 +1,65 @@
package sbu.javafx;
import javafx.fxml.FXML;
-import javafx.event.ActionEvent;
+import javafx.scene.Scene;
+import javafx.stage.Stage;
import javafx.scene.control.Label;
-import javafx.scene.input.MouseEvent;
+import javafx.scene.control.ListView;
import javafx.scene.layout.VBox;
+import java.util.ArrayList;
public class MusicController {
-
+ @FXML
+ private Label nowPlayingLabel;
+ private ArrayList playlist= new ArrayList<>();
// TODO: Define your UI components using the @FXML annotation.
//TODO: Implement the logic to play a song. This method should update the UI to show which song is currently playing.
@FXML
- public void handlePlayAction() {
+ public void playSummertime() {
+ nowPlayingLabel.setText("Now Playing: Summertime Sadness");
//Update labels, change button icons, etc.
}
+ public void playSpaghetti() {
+ nowPlayingLabel.setText("Now Playing: Spaghetti");
+ }
+ public void playBadShodam() {
+ nowPlayingLabel.setText("Now Playing: Bad Shodam");
+ }
//TODO: Logic to add a specific song to the user's playlist.
- public void addToPlaylist(String songName) {
- //Add the song to a list or update a ListView.
+ public void addSummertime() {
+ playlist.add("Summertime Sadness");
+ }
+ public void addSpaghetti() {
+ playlist.add("Spaghetti");
+ }
+ public void addBadShodam() {
+ playlist.add("Bad Shodam");
}
// TODO:This method should open a new window or change the current scene to display the "Playlist" page.
public void openPlaylistWindow() {
- //Create a new stage and show the playlist UI.
+ Stage playlistStage = new Stage();
+ playlistStage.setTitle("My Playlist");
+
+ ListView listView = new ListView<>();
+
+ listView.getItems().addAll(playlist);
+
+ if (playlist.isEmpty()) {
+ listView.setPlaceholder(new Label("Your playlist is empty!"));
+ }
+ VBox layout = new VBox(listView);
+ Scene scene = new Scene(layout, 300, 400);
+
+ playlistStage.setScene(scene);
+ playlistStage.show(); }
+
+ public void playSong() {
+
}
}
diff --git a/src/main/resources/sbu/javafx/App-view.fxml b/src/main/resources/sbu/javafx/App-view.fxml
index 306c8d3..36b54f5 100644
--- a/src/main/resources/sbu/javafx/App-view.fxml
+++ b/src/main/resources/sbu/javafx/App-view.fxml
@@ -1,8 +1,96 @@
-
-
+
+
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/sbu/javafx/style.css b/src/main/resources/sbu/javafx/style.css
new file mode 100644
index 0000000..e0eea1c
--- /dev/null
+++ b/src/main/resources/sbu/javafx/style.css
@@ -0,0 +1,50 @@
+/* The main container */
+.root-container {
+ -fx-background-color: white;
+}
+
+/* The box containing the table */
+.music-table {
+ -fx-border-color: black;
+ -fx-border-width: 1;
+}
+
+/* The header row */
+.table-header {
+ -fx-background-color: #f4f4f4;
+ -fx-border-color: black;
+ -fx-border-width: 0 0 1 0; /* Border only at the bottom */
+}
+
+.header-label {
+ -fx-font-weight: bold;
+ -fx-font-size: 14px;
+}
+
+/* Individual song rows */
+.table-row {
+ -fx-border-color: black;
+ -fx-border-width: 0 0 1 0; /* Border only at the bottom */
+}
+
+/* The last row shouldn't have a bottom border inside the box */
+.no-border {
+ -fx-border-width: 0;
+}
+
+/* The bottom "Now Playing" bar */
+.footer-bar {
+ -fx-border-color: black;
+ -fx-border-width: 1;
+}
+
+/* Buttons */
+.button {
+ -fx-background-color: white;
+ -fx-border-color: black;
+ -fx-cursor: hand;
+}
+
+.button:hover {
+ -fx-background-color: #eeeeee;
+}
\ No newline at end of file