Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Education > Homework, comp. sci. > Re: Painting on...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 3 Topic 4 of 33
Post > Topic >>

Re: Painting on a JPanel - HELP!

by "SPG" <steve.goodsell@[EMAIL PROTECTED] > Nov 12, 2003 at 01:29 PM

Does it help to put this code in the paint() method instead?
I have had trouble with re-painting using swing before, and found that
putting it all inpaint() helped.

Steve
"Graham Norman" <gcn1@[EMAIL PROTECTED]
> wrote in message
news:botacb$rmq$1@[EMAIL PROTECTED]
> 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.
>
>
 




 3 Posts in Topic:
Painting on a JPanel - HELP!
"Graham Norman"  2003-11-12 12:51:23 
Re: Painting on a JPanel - HELP!
"SPG" <steve  2003-11-12 13:29:19 
Re: Painting on a JPanel - HELP!
Bryan Boone <Bryan.Boo  2003-11-12 16:54:22 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 20:35:06 CST 2008.