This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan 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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 36
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: 9990
    
    7

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: 36
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 an Image
Refresh problem in applet
loading image
Adding Image, Bolds to JTextPane
Escape sequences