HW7
This commit is contained in:
@@ -3,6 +3,7 @@ package sbu.javafx;
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -13,11 +14,16 @@ 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(), 450, 350);
|
||||
stage.setTitle("Music Player");
|
||||
|
||||
try {
|
||||
stage.getIcons().add(new Image(MusicApp.class.getResourceAsStream("icon.png")));
|
||||
} catch (Exception ignored) {
|
||||
// Icon file not found, continuing without icon
|
||||
}
|
||||
|
||||
stage.setScene(scene);
|
||||
//TODO: add icon to the stage
|
||||
stage.show();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user