This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes creatimageicon method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "creatimageicon method" Watch "creatimageicon method" New topic
Author

creatimageicon method

shaon husain
Ranch Hand

Joined: Mar 20, 2013
Posts: 37
i have the code

how do i get the else to display an image, ive got an image to show when there isnt an image, how do i do this.

ie, if there isnt an image show this image instead.
thanks
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10172
    
    8

You will need to treat as the new path, create the URL->ImageIcon and return it.
This will work provided the image exists at the path above


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
shaon husain
Ranch Hand

Joined: Mar 20, 2013
Posts: 37
Maneesh Godbole wrote:You will need to treat as the new path, create the URL->ImageIcon and return it.
This will work provided the image exists at the path above


i have done this, is this the best way,

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: creatimageicon method
 
Similar Threads
loading image
Loading an Image
Adding Image, Bolds to JTextPane
Refresh problem in applet
Escape sequences