Results 1 to 2 of 2

Thread: Image in jLabel

  1. #1
    abul.cse is offline Member
    Join Date
    Nov 2012
    Posts
    1
    Rep Power
    0

    Default Image in jLabel

    I have used jLabel to display a image. In jFrame3 I gave a option to change image using jFileChooser for a particular user.After I change the image of particular user using the form jFrame3, I try to view the details of the details where i could find only my old photo for the particular user. I have checked the directory where the images are stored . In the directory the image is updated to new one. May I know what is the problem?
    (Note: I store all details of a user in database(MS Access) and image are stored in a directory "img" . To change the photo I delete the old one and save the new one with the same file name as before)

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,197
    Rep Power
    19

    Default Re: Image in jLabel

    If you're loading the image (directly or indirectly) via java.awt.Toolkit, be aware that Toolkit caches image data. Calling flush() on the image is then the only way to force a reload from disk.

    If that's not it, post a SSCCE (Short, Self Contained, Correct (Compilable), Example) that demonstrates the problem and we'll take a look.

    db

    Note: Keep it short and relevant. We don't want to see all your code, and we don't want to wade through IDE/visual designer-generated gobbledygook.
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. how to resize image to fit it into a jlabel
    By shruts in forum AWT / Swing
    Replies: 2
    Last Post: 07-07-2012, 07:50 AM
  2. Displaying image in jLabel
    By victaino in forum New To Java
    Replies: 10
    Last Post: 05-17-2012, 05:12 AM
  3. Using Image in JLabel? Please Help! :-)
    By Alerhau in forum New To Java
    Replies: 9
    Last Post: 09-07-2011, 06:48 PM
  4. Image On a JLabel
    By corbokhan in forum New To Java
    Replies: 11
    Last Post: 11-06-2010, 12:18 AM
  5. Image in JLabel
    By ishere11 in forum AWT / Swing
    Replies: 2
    Last Post: 04-29-2010, 08:02 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
  •