Results 1 to 4 of 4
  1. #1
    pflerman is offline Member
    Join Date
    Sep 2011
    Posts
    5
    Rep Power
    0

    Default JPanel with background image

    Hello, i want to make a JPanel with a background image, but i canīt do it.

    Iīm using eclipse for ide, and i donīt know how to import images to eclipse and then show in a program in a JPanel or a ImageIcon.

    Can anyone helpme to import the images to eclipse and a litle source code for display it.

    Thanks

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: JPanel with background image

    To import images into Eclipse, you can simply drag and drop the image into a folder in the Package Explorer. I usually create an images folder and place my images there.

    As to code to display, I don't think we need to recreate this for you as there are many many examples of this on the web. Please give it a try and then come on back with your code if you get stuck.

  3. #3
    pflerman is offline Member
    Join Date
    Sep 2011
    Posts
    5
    Rep Power
    0

    Default Re: JPanel with background image

    Fubarabl:

    Thanks you very much, I finally can do it... I create a folder within the proyect..

    My mistake was that the floder i created within the SRC package.

    Now I can link the images to ths folder.

    Regards

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. jpanel background -java
    By felito in forum New To Java
    Replies: 7
    Last Post: 02-14-2011, 08:29 PM
  2. Can JDesktopPane can have a background JPanel?
    By chyrl in forum AWT / Swing
    Replies: 13
    Last Post: 10-22-2010, 07:56 AM
  3. Change JPanel background after its been set once
    By mevets in forum AWT / Swing
    Replies: 4
    Last Post: 04-14-2010, 02:07 AM
  4. background color with jpanel
    By hannerz06 in forum New To Java
    Replies: 6
    Last Post: 03-31-2010, 04:25 AM
  5. how to put a background image in a JPanel
    By yanipao in forum New To Java
    Replies: 5
    Last Post: 10-21-2009, 03:27 PM

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
  •