29 lines
799 B
Java
29 lines
799 B
Java
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;
|
|
|
|
public class MusicApp extends Application {
|
|
|
|
@Override
|
|
public void start(Stage stage) throws IOException
|
|
{
|
|
FXMLLoader fxmlLoader = new FXMLLoader(MusicApp.class.getResource("App-view.fxml"));
|
|
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);
|
|
stage.show();
|
|
}
|
|
} |