0

I would like to put in a background gradient using the NetBeans GUI Builder. I know I can layer components, but I can't seem to find out how to put in an image that fills the screen, and really don't know if layered components is even the right way. Even then, the only GUI-builder way I know to put in an image is to add an icon to a label.

I would prefer not to write the code manually (which I am fully capable of). If the GUI builder supports this functionality, I would much prefer to stick to it.

I am not much familiar with swing, especially look and feel. Only the layout section. I am familiar with HTML and Android layouts.

700 Software
  • 85,281
  • 83
  • 234
  • 341

1 Answers1

1

but I can't seem to find out how to put in an image that fills the screen,

You need to do custom painting. Background Panel does this for you.

camickr
  • 321,443
  • 19
  • 166
  • 288
  • I don't use GUI Builders. I write my own code. I'm sure the GUI Builder allows you to extend classes and customize the code, so you can easily copy the relevant code and use it as you wish. – camickr Jun 15 '11 at 19:41
  • 1
    Absolutely! Work with the Properties Window in Netbeans. Everything you might want to change is there. Switch back to the generated code to see if what you did was added the way you wanted. – Costis Aivalis Jun 15 '11 at 19:41
  • I was hoping for a GUI builder way to do this, but I guess NetBeans still has a way to go yet! I used NetBeans 7.0 Customize Code which allows me to customize the constructor code and replace `new JPanel()` with `new BackgroundPanel(...)`. – 700 Software Jun 15 '11 at 21:04
  • "...NetBeans still has a way to go yet!..." Not really! Netbeans allows you to define your own Beans and add them to your toolbox, so that you can reuse them at a future time. – Costis Aivalis Jun 15 '11 at 23:47