• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JLabel icon redrawing problem

 
D R Wilkinson
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Call repaint to show the new state:

Also, you might consider overriding paintComponent in MapHex instead of paint.
 
D R Wilkinson
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic