This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes Draging componets like JButtons during runtime in JFrame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Draging componets like JButtons during runtime in JFrame" Watch "Draging componets like JButtons during runtime in JFrame" New topic
Author

Draging componets like JButtons during runtime in JFrame

Abhishek Abhinav
Greenhorn

Joined: Feb 18, 2013
Posts: 5
I wanted to add an JFrame with JButton to my application in which user can drag component(JButton) to some extend and then it could open different JFrame
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10268
    
    8

Welcome to the Ranch.

Let us know if you get stuck and share your SSCCE code so we can help point you in the right direction.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38462
    
  23
Dragging buttons? Opening second frames? Both sound very iffy. If you want a secondary display, use a dialogue window, not a frame.
Abhishek Abhinav
Greenhorn

Joined: Feb 18, 2013
Posts: 5
Sir you aren't getting what i mean to say !!
You have usually seen in cell phone that they provide Lock guard screen where a user have to drag a button to certain extent and then the screen gets unlocked leading to home screen.
Now in my application i wanted to build the same Lock Guard Screen !! when user clicks Lock buttons then a Lock screen JFrame appears where only one buttons is displayed,now user have to drag that button to certain extent to unlock the system and resume working
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38462
    
  23
That is not a frame, but a dialogue.
You are going round things the wrong way if you are quoting class names at this stage. You should simply say it is a display, and you have to drag across it. Later on, you can decide what class to implement it with.
Abhishek Abhinav
Greenhorn

Joined: Feb 18, 2013
Posts: 5
Campbell Ritchie wrote:That is not a frame, but a dialogue.
You are going round things the wrong way if you are quoting class names at this stage. You should simply say it is a display, and you have to drag across it. Later on, you can decide what class to implement it with.


can you please provide me with some example !! because i`m not getting what you are trying to say.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38462
    
  23
Try this FAQ.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Draging componets like JButtons during runtime in JFrame