Results 1 to 2 of 2
Thread: resize image in java form
- 02-16-2011, 06:06 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 1
- Rep Power
- 0
resize image in java form
I stored the path of the image to be rescaled in the string variable 'path'
then i tried this code to resize and display the image. but it didn't work.
it shows an error
jLabel1.setIcon(new javax.swing.ImageIcon(getScaledImage("path", 32, 32)))
but this code produces an error displaying unable to find method getScaledImage.
What to do for this... waiting for help
Advance thanks
http://www.java-forums.org/images/smilies/redface.gif
- 02-16-2011, 08:24 PM #2
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,609
- Rep Power
- 5
And we don't know what getScaledImage is either. Did you define it somewhere? Are you trying to call a method defined in a class (in which case you must call it on an instance of that class)? The Image class contains the method getScaledInstance, but you must call that function on an Image object.but this code produces an error displaying unable to find method getScaledImage.
Similar Threads
-
How to do High Quality Image Resize
By Jonah Bron in forum SWT / JFaceReplies: 0Last Post: 01-15-2011, 01:30 AM -
Help: How to auto-resize the image icon to fit in the jlabel
By weikang in forum AWT / SwingReplies: 2Last Post: 11-24-2010, 02:38 PM -
how to resize an image
By marodia in forum AWT / SwingReplies: 2Last Post: 08-21-2009, 04:10 AM -
Can't resize textarea in JPanel Form
By wiguy in forum NetBeansReplies: 0Last Post: 04-02-2009, 10:58 AM -
Image Resize
By jithan in forum New To JavaReplies: 4Last Post: 11-07-2008, 09:26 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks