Question

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.

Was it helpful?

Solution

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')))
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top