• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTabbedPane Icon click

 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to determine if the mouse was clicked on a JTabbedPane tab Icon? I can determine if it occurred on the tab using the method getBoundsAt(int). I haven't tried, but I suspect I could subclass ImageIcon, intercept the call to paintIcon and provide accessor methods to x and y, and determine if the click occurred on the Icon through that, but I suspect there is a better way?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is probably what you're talking about, but it seems top work OK

 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Excellent thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!