I'm adding my application icon with stage.getIcons().add(new Image("path")) and the icon will appear sometimes, so I know that the program can find the resource and I'm calling the right methods, but the icon won't appear every time. From what I can tell from this question this is probably because swing (which I believe JavaFX uses) loads images in a separate thread. If this is the problem, how can I ensure that loading and adding the icon finishes before I call stage.show()? If this is not the problem, what is going on here and what am I doing wrong? I'm using JRuby so your answer can include Ruby libs if they're applicable. A purely Java answer is fine too.
JavaFX 8 - Application Icon will only sometimes appear
324 views Asked by griest At
1
There are 1 answers
Related Questions in JAVA
- Add image to JCheckBoxMenuItem
- How to access invisible Unordered List element with Selenium WebDriver using Java
- Inheritance in Java, apparent type vs actual type
- Java catch the ball Game
- Access objects variable & method by name
- GridBagLayout is displaying JTextField and JTextArea as short, vertical lines
- Perform a task each interval
- Compound classes stored in an array are not accessible in selenium java
- How to avoid concurrent access to a resource?
- Why does processing goes slower on implementing try catch block in java?
Related Questions in JAVAFX
- JAVAFX error incompatible types: FXMLLoader cannot be converted to node
- How to resolve browser crash issue in JavaFX?
- JavaFX can't play mp3 files
- JavaFX 8 Load external FXML
- All my JavaFX TextFields have lines in them
- Javafx TableView with custom row color using CSS
- Java for Mobile and Desktop Development
- Create Dialogs with Default Images in JavaFX (Info/Warning/Error)
- In javaFx is it possible to make rounded corner of a Rectangle except right-bottom?
- using javafx 8 (java 8 install) How to extend Label.setTooltip Display time to 20secs (while mouse is inside Tooltip)
Related Questions in JRUBY
- syntax error, unexpected kEND
- Jruby: How to use third party java library?
- How to override rake database tasks in rails 4
- java.lang.ArithmeticException: Negative exponent in jruby
- Swing application closes right away after launch
- JRuby/Gem logging "Ignoring thrift-0.9.0 because its extensions are not built"
- How do you install the JRuby SDK in IntelliJ 14.1.3 and up?
- Generate MD5 Hash of String in JRuby
- JRuby: changed CLASSPATH but no effect
- Image error observed while trying to use Sikuli with JRuby and Cucumber
Related Questions in JAVAFX-8
- JavaFX 8 Load external FXML
- How to replace a scene component with a button click inJavaFX
- Using ReactFX to resize stage when nodes become invisible?
- Black Screen - Default Gluon Project
- create and display multiple windows simultaneously using javaFX
- Bind the result of list.contains() method
- JavaFX- Don't scale image for stage icon?
- How to load own font from CSS file into JavaFX application (I'm using now JDK 8u45)
- Where can I find the JavaFX 8 source code for skin classes?
- How do I set the background color of an anchorpane with CSS in Java FX
Related Questions in JRUBYFX
- OpenJFX TreeTableView rendering issue
- JavaFX 8 - Application Icon will only sometimes appear
- Can't populate a TableView with Jruby/Jrubyfx
- Use JavaFX 8 controls with 2.2 controls in JRubyFX
- Jruby - Javafx : How to add icon to button?
- How do I get the window object from the controller, but in JRubyFX
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Hello I think that the program process that loads the image does did not finish loading before you are showing it. You can add a
wait()function after your icon addition. Or you can execute another function in between youradd(new Image("pokemon.png"))and yourprimaryStage.show()this will ensure that your image load will finish before you show the stage.