में नहीं है यह थोड़ा अजीब है या शायद मेरे कोड में कुछ गड़बड़ है।जावाफ़ैक्स एप्लिकेशन के लिए आईसीओएन सेट विंडोज में दिखाई देता है लेकिन उबंटू
मैं जावाएफएक्स एप्लिकेशन आईसीओएन सेट कर रहा हूं जो विंडोज सिस्टम पर बहुत अच्छी तरह से दिखाई दे रहा है लेकिन उबंटू पर नहीं।
विंडोज पर:
उबंटू पर:
इस के पीछे कारण के बारे में कोई विचार है।
कोड नमूना:
@Override
public void start(Stage stage) throws Exception {
try {
setUserAgentStylesheet(STYLESHEET_MODENA);
FXMLLoader loader = new FXMLLoader();
Parent root = (Parent) loader.load(getClass().getResourceAsStream("ui/ParentWindow.fxml"));
final ParentWindowController controller = (ParentWindowController) loader.getController();
stage.addEventHandler(WindowEvent.WINDOW_SHOWN, controller::handleWindowShownEvent);
stage.addEventHandler(WindowEvent.WINDOW_SHOWING, controller::handleWindowShowingEvent);
stage.addEventHandler(WindowEvent.WINDOW_CLOSE_REQUEST, controller::handleWindowClosingRequestedEvent);
Scene scene = new Scene(root);
scene.getStylesheets().setAll(
getClass().getResource("ui/css/ParentWindow.css").toExternalForm()
);
stage.setScene(scene);
stage.initStyle(StageStyle.UNIFIED);
stage.setResizable(false);
stage.toFront();
stage.setTitle("Simple JavaFX Tool");
stage.getIcons().add(new Image(getClass().getResourceAsStream("resources/images/icon.jpg")));
stage.show();
} catch (IOException iOException) {
iOException.printStackTrace();
}
}
[सिर्फ विभिन्न आकारों में अपने आइकन का आकार और उन्हें के रूप में सभी इसे यहाँ जवाब] (http://stackoverflow.com/questions/27017031/javafx-2-window-icon-not-working) [यहां मानक हैं आकार] (http://www.visualpharm.com/articles/icon_sizes.html) उम्मीद है कि यह मदद करता है :) –