forked from AdvancedProgramming1404/HW-07-JavaFX
47 lines
1.9 KiB
Java
47 lines
1.9 KiB
Java
package sbu.javafx;
|
|
|
|
import javafx.application.Application;
|
|
import javafx.fxml.FXMLLoader;
|
|
import javafx.scene.Parent;
|
|
import javafx.scene.Scene;
|
|
import javafx.stage.Stage;
|
|
|
|
public class Main extends Application {
|
|
@Override
|
|
public void start(Stage primaryStage) throws Exception {
|
|
|
|
FXMLLoader loader = new FXMLLoader(getClass().getResource("/sbu/javafx/App-view.fxml"));
|
|
Parent root = loader.load();
|
|
|
|
MusicController controller = loader.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", "/music/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/light.css").toExternalForm()
|
|
);
|
|
|
|
primaryStage.setTitle("Music Player");
|
|
primaryStage.setScene(scene);
|
|
primaryStage.setResizable(false);
|
|
primaryStage.show();
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
launch(args);
|
|
}
|
|
} |