How do you add Background Image in JPanel (NetBeans GUI Builder)

Viewed 66730

I have JTabbedPane with five tabs and each have Jpanel i want add different images for each panel in NetBeans IDE

3 Answers

May be you'll find this link useful.

This tutorial shows you how to use the IDE's GUI Builder to generate the code to include images (and other resources) in your application. In addition, you will learn how to customize the way the IDE generates image handling code.

Handling Images in a Java GUI Application

Basically, following are the steps.

  1. Drag a Label to the JFrame
  2. Add a new package (for the image to be stored)
  3. Select Label and go to the Properties category
  4. Select the Icon property and click 'Import to Project...'
  5. Select the image and then the newly created package
  6. In Properties window of Label, select text property and delete it.
Related