0

I was trying using the CSSBuilder plugin but it seems that it does not support the CSS background image property.

I have been searching in google and it seems you can add background image to a swing panel by subclassing the panel. But I am pretty new to Swing and I do not know how to do it. I would like to know if there is an easier way to accomplish this with griffon.

Thanks in advanced.

Sergio del Amo
  • 76,835
  • 68
  • 152
  • 179

1 Answers1

1

Here's one possible to solution:

  1. install the javatips plugin, i.e, griffon install-plugin javatips
  2. Use the backgroundPanel() node

Here's a barebones example

package sample
import javax.imageio.ImageIO

application(title: 'Sample',
    preferredSize: [320, 330],
     pack: true) {
     backgroundPanel(image: ImageIO.read(app.getResourceAsURL('griffon-icon-256x256.png')))
}
Andres Almiray
  • 3,236
  • 18
  • 28