This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to avoid dragging the Frame by clicking TitleBar?  RSS feed

 
Sathiq Ali
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to avoid dragging the Frame by clicking TitleBar?
 
Vasu Reddy
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

You can do that by adding component listener to your frame. Here i am giving simple program.

 
David Weitzman
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might consider using a raw window instead of a frame. If there's no title bar, the user won't be using it to move the window.
 
Ken Blair
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem with that code is the frame is still movable, it just goes back to where it started after it's moved. I'm not aware of anyway to achieve this short of creating an undecorated window and painting a titlebar yourself. I don't think you have control over the title bar otherwise since it's part of the OS and not Java.
 
shilpa patil
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey...if you r using internal frames...
Then u can use DefaultDeskTopManager to place the fram after dragging
to its dragged palce
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!