Graham Norman wrote:
> I have overridden the following method with:
>
> protected void paintComponent(Graphics g)
> {
> super.paintComponent(g);
> Graphics2D g2 = (Graphics2D)g;
> JigsawPiece tmp;
>
> while (hasNext())
> {
> tmp = nextJigsawPiece();
> g2.drawImage(tmp.getPartialImage(), tmp.getRelativeXCoord(),
> tmp.getRelativeYCoord(), this);
> }
> }
>
> When I load my program, nothing appears. I go to resize the window and
the
> image appears, I move or resize the window again and it dissappears.
>
> Pleeease help me,
> Graham.
>
>
You need to override getPreferredSize() to return the preferred size of
the JPanel.


|