Extending HContainer

I've subclassed HContainer in order to provide a container with a background fill. If I add text components, it works well. But when I add a HStaticIcon component, doesn't show the component.

I can see the HStaticIcon component is added and the space for him is left, but it's not painted.

The code is like this:

For the container:

publicclass ColorPanelextends HContainer{

publicvoid paint(Graphics g){

g.setColor(getBackground());

g.fillRect(this.getBounds().x, this.getBounds().y, this.getSize().width, this.getSize().height);

super.paint(g);

}

}

When I use it at Xlet, with more code about more components and Containers, and LayoutManagers managing it:

ColorPanel info =new ColorPanel(0, 0, 420, 200);

info.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));

info.setBackground(Color.blue);

Image cab1 = scene.getToolkit().getImage("img/rojo.gif");

HStaticIcon ico1 =new HStaticIcon(cab1, 0, 0, 16, 16);

ico1.setBordersEnabled(false);

info.add(ico1);

If I put on the HStaticIcon:

ico1.setBackgroundMode(HVisible.BACKGROUND_FILL);

I can see the rectangle of the image coloured, so I suppose the image is here, but doesn't render.

Any help will be appreciated.

Greetings,

Eva.

[1766 byte] By [EVLa] at [2007-11-27 5:24:53]
# 1
Now the image it's rendering ok. The image it's smaller than the container, so I expected to see the background color I configured to the container, but what I see is a white background.Any ideas?Greetings,Eva.
EVLa at 2007-7-12 14:44:35 > top of Java-index,Java Mobility Forums,Consumer and Commerce...