forked from AdvancedProgramming1404/HW-07-JavaFX
صفحه اصلی بدون اعمال پلی لیست
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
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"),
|
||||
new Song("Flowers", "Miley Cyrus"),
|
||||
new Song("As It Was", "Harry Styles")
|
||||
);
|
||||
|
||||
controller.setupListView(controller.musicsListView);
|
||||
|
||||
Scene scene = new Scene(root, 600, 500);
|
||||
scene.getStylesheets().add(
|
||||
getClass().getResource("/css/light.css").toExternalForm()
|
||||
);
|
||||
|
||||
primaryStage.setTitle("Music Player");
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user