In many situations, you may want to display the image from the instance of BufferedImage for debugging purposes.
The obvious way is to create a JPanel and overrides its paint(Graphics g) method. But that consumes time and energy!
The better solution is to instantiate an object of ImageIcon and use its setImage(Image image) method to host the BufferedImage instance in it. After that, you can easily display the image by using JOptionPane.
6 comments:
Thanks!! It's very useful.
But... why don't use 'is/are to' instead of 'was to'?
^ ^
Thanks! It's my grammar mistake :$
It will be corrected very soon :)
Thanks, your code helped me. But could you provide it without HTML Tags? It's hard to copy and paste with all those
s around.
Such a great little idea. Saved me a precious few minutes, thanks!
Hey that was helpful! Thank you!
It is really usefull, thanks!
Post a Comment