GetRuntime(). Exec is for launching an external program. To simple load a file to use in your Java application you can simply treat it like any other file.
Indeed if you are using Swing, the ImageIcon constructor will take a String containing the file path as an argument.
GetRuntime(). Exec is for launching an external program. To simple load a file to use in your Java application you can simply treat it like any other file.
Indeed if you are using Swing, the ImageIcon constructor will take a String containing the file path as an argument. stackoverflow.com/questions/299495/java-... The above question explains how to add an image to a JPanel and this can be done at runtime by an event handler.
I was sort of giving context for why I'm adding an image with the p.Runtime.getRuntime().exec()...that is just running a python script that saves out the image I am looking to post. It has nothing to do with the image except for generating it. – Brandon Apr 14 '10 at 22:18.
That is just running a python script that saves out the image I am looking to post Sounds like the problem is that the code is trying load the image before the python script finishes creating the image. Try: Process p = Runtime.getRuntime(). Exec("..."); p.waitFor(); Icon icon = new ImageIcon(...).
1 for waitFor The whole processing ( invoking the script and waiting for the result ) should be run in a separate thread though. Otherwise it will freeze the UI. Later it should call SwingUtilities.
InvokeLater to update the UI – OscarRyz Apr 15 '10 at 0:09.
You can also use labels to display images. This tutorial shows you how.
Roc_image is a label...therefore it's already being added to a label. – Brandon Apr 14 '10 at 22:41.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.