Results 1 to 2 of 2
  1. #1
    manukurakar is offline Member
    Join Date
    Feb 2011
    Posts
    1
    Rep Power
    0

    Default 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

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,641
    Rep Power
    7

    Default

    but this code produces an error displaying unable to find method getScaledImage.
    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.

Similar Threads

  1. How to do High Quality Image Resize
    By Jonah Bron in forum SWT / JFace
    Replies: 0
    Last Post: 01-15-2011, 01:30 AM
  2. Replies: 2
    Last Post: 11-24-2010, 02:38 PM
  3. how to resize an image
    By marodia in forum AWT / Swing
    Replies: 2
    Last Post: 08-21-2009, 04:10 AM
  4. Can't resize textarea in JPanel Form
    By wiguy in forum NetBeans
    Replies: 0
    Last Post: 04-02-2009, 10:58 AM
  5. Image Resize
    By jithan in forum New To Java
    Replies: 4
    Last Post: 11-07-2008, 09:26 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •