Results 1 to 2 of 2
  1. #1
    safiya is offline Member
    Join Date
    Oct 2008
    Posts
    2
    Rep Power
    0

    Default picture backround

    how do you put a picture as the backround on a jpanel

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Did you search on the web about this. All you have to read about ImageIcon, and layouts. Read API for more details.

    First create a ImageIcon to the image you want. Then create a JLabel with adding that ImageIcon, there is an overloaded method to add an image into a label. Get the layered pane, getLayedPane() and add that label into that. That's all.

    Put some effort and get back here if you stuck with something. But put some effort first. I've given all what you need.

Similar Threads

  1. how to import a picture into an applet
    By cecily in forum Java Applets
    Replies: 2
    Last Post: 01-15-2010, 08:51 PM
  2. Setting a picture on a button
    By tomhcole in forum New To Java
    Replies: 2
    Last Post: 09-26-2008, 03:30 AM
  3. Picture help
    By deathnote11 in forum AWT / Swing
    Replies: 13
    Last Post: 06-03-2008, 05:46 PM
  4. Picture in a JFrame problem
    By saytri in forum New To Java
    Replies: 3
    Last Post: 01-12-2008, 09:44 AM
  5. Print a picture file
    By oli001 in forum New To Java
    Replies: 0
    Last Post: 11-26-2007, 01:40 PM

Posting Permissions

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