aspose file tools*
The moose likes I/O and Streams and the fly likes Reading images problem. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Reading images problem. " Watch "Reading images problem. " New topic
Author

Reading images problem.

Edmund Petrof
Greenhorn

Joined: Jan 09, 2012
Posts: 9

Hello all, I got question about reading image's. Anyway to short story, I have make embedded database. Works fine. Have Varchar to ceap path of image and display to jLabel.

Problem - i have set Auto re-size on Jlabel and each time i have click on row on table, jlabel display a image but next one is larger for some pixels. After a Few clicks he is going larger over the program.
I can fix that to set dimensions on jlablel and she will not grown.

Anyhow. This is the code what do resize and display at jlabel.
String name gets image path "C:/applicationfolder/images/image1.jpg"


I have question to replace this code whit simple one.
In String name to be only "Image1.jpg" to have MAPS1.setIcon(new ImageIcon(resiImage)); switched to MAPSSL.setIcon(new ImageIcon(getClass().getClassLoader().getResource("")));

And here is my problem how to add string to at .geResource("") something like this



I hope that i have explain what i thinking. Anyway thanks for your time.


EDIT
I just do the same thing whit original code. just put /images/image1.jpg at jTextField1 and it working. So let this topic stay to remind me how full on retarded i have been. Ty vm
Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 2316
    
  49
Good to hear you have solved the problem and thanks for updating your post.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reading images problem.