Hey guys,

I've drawn a grid, and I have a label contatining a picture. Whenever I change the location of this label, the grid dissapears until I resize/move the frame.

Any suggestions on best method to buffer these grid lines?

They aren't going to be moving graphics or anything like that so I'm hoping for the most easiest method.

pseudocode
> draw x line
> draw y line
>set bounds of label to x,y

Any ideas appeciated.

Recommended Answers

All 2 Replies

I assume you are drawing the grid in an overridden paintComponent?
After moving the label you should just call repaint() to let Swing know that the container's paintComponent needs to be called a.s.a.p.

Cheers, just needed the repaint() within the paintComponent method!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.