> i would like to add JLabels to a custom JPanel. But even with the "null
> layout", JLabel are not drawn at all.
They are being drawn, but they have a size of [0,0], so they are difficult
to see.
> I i remove the line which sets the layout to null, all the JLabels are
> displayed in "grid" after a resize of the app.
That is because the layout manager sets the size (and position) for the
components in the container that it lays out.
> I was using only setLocation(), without asking a "preferred size". Now i
> use setBounds() and the JLabels are drawn(ed?).
Calling setBounds() is equivalent to calling setLocation() and setSize(),
so now the size is being set.
However, this is really not the best way to lay out a container in Java.
You seem to be dynamically computing the positions -- I presume that is
what the drawPanel object does -- which is a good thing. But in Java,
sizing and positioning of child components is normally done by a layout
manager.
If you just placed those computations in a LayoutManager, your component
would probably work better. The LayoutManager will be automatically
called when conditions change that could affect the layout. It would also
be more flexible, since code that uses the component could replace the
layout if it needed to.
I also wonder whether those computations could be done with one of the
standard LayoutManagers. There are quite a few to choose from and some of
them are quite powerful. There is no reason to write a lot of positioning
and sizing code if it has already been done.

Signature
Regards,
John McGrath