File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes JLabel icon redrawing problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JLabel icon redrawing problem" Watch "JLabel icon redrawing problem" New topic
Author

JLabel icon redrawing problem

D R Wilkinson
Ranch Hand

Joined: Oct 29, 2004
Posts: 51
Hello :-)

I am having trouble getting my MapHex (extends JLabel) to redraw itself properly. At the moment, each map hex only redraws as red when the tool text tip object moves off the hex that should have changed colour when the cursor entered or exited the map hex.

The map hexes are displayed within MapPanel (extends JPanel).

Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
Call repaint to show the new state:

Also, you might consider overriding paintComponent in MapHex instead of paint.
D R Wilkinson
Ranch Hand

Joined: Oct 29, 2004
Posts: 51
Thank you very much

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: JLabel icon redrawing problem
 
Similar Threads
Paint Drag Preview
repainting JLabels on a JPanel
BufferedImage to JScrollPane
Smiling Face
BlueJ Error Message Please Help