Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Add mouse listener to JFrame TITLE BAR  RSS feed

 
Eric Crockett
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am able to listen in my entire frame for mouse clicks, but ironically enought, not on the frame itself(mainly the title bar). I have tried to add a mouseListener and an actionListener, neither work. Any ideas?
 
Torgil Zethson
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't add a MouseListener to the titlebar of a JFrame since the titlebar is not provided by Java, but by the underlying operating system. You'll find one possible workaround here:

http://forum.java.sun.com/thread.jspa?threadID=634532
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!