This commit is contained in:
2026-05-29 00:10:41 +03:30
parent 574ef215ee
commit f2a9b8021e
5 changed files with 139 additions and 26 deletions
+32 -1
View File
@@ -2,7 +2,9 @@ package sbu.javafx;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import java.io.IOException;
@@ -13,9 +15,38 @@ 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());
Parent root = fxmlLoader.load();
MusicController controller = fxmlLoader.getController();
controller.musicsListView.getItems().addAll(
new Song("Blinding Lights", "The Weeknd","/musics/The-Weeknd-Blinding-Lights-128.mp3"),
new Song("Comme des enfants", "Coert De Pirate","/musics/Coeur-De-Pirate-Comme-des-enfants-128.mp3"),
new Song("Slow Down", "GRAE", "/musics/GRAE-Slow-Down-128.mp3"),
new Song("Cigarettes out the Window", "TV Girl", "/musics/TV-Girl-Cigarettes-out-the-Window-128.mp3"),
new Song("deja vu", "Olivia Rodirgo", "/musics/Olivia-Rodrigo-deja-vu-320.mp3"),
new Song("The Line", "Twoenty One Pilots", "/musics/Twenty-One-Pilots-The-Line-128.mp3"),
new Song("Bones", "Imagine Dragons", "/musics/Imagine-Dragons-Bones-128.mp3"),
new Song("Bunker", "Balthazar", "/musics/Balthazar-Bunker-128.mp3"),
new Song("As It Was", "Harry Styles", "/musics/Harry-Styles-As-It-Was-320.mp3")
);
controller.setupListView(controller.musicsListView);
controller.setupListView(controller.playlistListView);
Scene scene = new Scene(root, 500, 600);
scene.getStylesheets().add(
getClass().getResource("/css/dark.css").toExternalForm()
);
stage.setTitle("Music Player");
stage.getIcons().add(
new Image(getClass().getResourceAsStream("/image/icon.png"))
);
stage.setScene(scene);
stage.setResizable(false);
//TODO: add icon to the stage
stage.show();
}