This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Moving a component using mouse  RSS feed

 
Kapil Sibby
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am looking for a ready made Container (may be extension of JPabel) into which I can add components such that I can move the component dynamically with mouse.
Is there any such container available? If not, is there a standard way to do it?
I am able to do rudimemtary moving logic by extending a JPanel and using null layoutmanager etc. But I am not sure whether I am doing it the right way. Here is my code:
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know of a ready made component for this that is in the JDK. That doesn't mean that there isn't one out there. I have just never hunted for one. As far as how you are doing it currently, if it works, it works. Sometimes the correct way is the working way. And with swing, this is all too often the case I am afraid.
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!