File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

image label

 
Jude Fawly
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i am using an image label. images with sizes 200x200 will fit in the label and the whole
display is neat. but when i load an image with width 300 pix for example, the whole display
gets messed up.
How can i be able to load any image size in the image label while keeping the display neat.
if this is not possible, how can i limit the JFileChooser to choose images with 200X200 pixels?

thanks for any help
 
Rob Spoor
Sheriff
Pie
Posts: 20396
47
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could choose to resize images if their sizes are not 200x200.

You can retrieve an Image object from an ImageIcon, scale it and set it again.
 
Ko Wey
Ranch Hand
Posts: 67
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be you could use a home-made image-panel, like this:
(this imagepanel will be the exact size of the image when placed in
an appropriate container)

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic