Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Drag n drop in JLabels.  RSS feed

 
Arun Thulaseedharan
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
When we drag from the label1 to label2 the contents of the label1 is painted onto label 2 with out we explicitly calling label2.repaint().
Can anyone tell in which class this repainting is happening behind the scene??

thanks in advance,
arun
 
Brian Cole
Author
Ranch Hand
Posts: 949
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Arun Thulaseedharan:
When we drag from the label1 to label2 the contents of the label1 is painted onto label 2 with out we explicitly calling label2.repaint().
Can anyone tell in which class this repainting is happening behind the scene??


JLabel.setText() calls repaint() unless the new text is the same as the old text. This makes sense, no?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!