Add Style
This commit is contained in:
@@ -4,7 +4,8 @@ import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import javafx.scene.image.Image;
|
||||
import java.awt.*;
|
||||
import java.io.IOException;
|
||||
|
||||
public class MusicApp extends Application {
|
||||
@@ -14,8 +15,16 @@ public class MusicApp extends Application {
|
||||
{
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(MusicApp.class.getResource("App-view.fxml"));
|
||||
Scene scene = new Scene(fxmlLoader.load());
|
||||
|
||||
String lightStyle = getClass().getResource("light.css").toExternalForm();
|
||||
scene.getStylesheets().add(lightStyle);
|
||||
|
||||
stage.setTitle("Music Player");
|
||||
stage.setScene(scene);
|
||||
|
||||
Image icon = new Image(getClass().getResourceAsStream("icon.png"));
|
||||
stage.getIcons().add(icon);
|
||||
|
||||
stage.show();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user