• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to import background image into netbeans's Desktop application?

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends,

Iam using netbeans 6.5. i created swing desktop application.in that form i cannot import or set background image.
in JButton it have option to set icon image.

but in form doesnot have.

if possible to setBackground image using form properties?

anybody know how to set bsckground image.

thanks in advance.


 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do yourself a huge favor and stop using IDEs which automatically generate code for you. That way you will never learn.

You need to paint the image as a background on a panel and then set the panel as the content pane.
http://faq.javaranch.com/java/BackgroundImageOnJPanel
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There isn't a function to do that, you have to set a JLabel with your icon property set to the picture and set it to the length and width of the JFrame and set the JFrame's layout property value to null. Then just change the order of the buttons/Labels and what have you so that the background is in fact, in the back.
For a more detailed solution to the particular problem,go to

http://www.netbeanstutorials.com/p/setting-background-image.html

There's even a video how to do it there. I know I was specific but to a newbie it can be overwhelming.
 
reply
    Bookmark Topic Watch Topic
  • New Topic