jQuery in Action, 2nd edition*
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 Android Security Essentials Live Lessons this week in the Android 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: 10170
    
    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: 38033
    
  22
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: 38033
    
  22
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: 38033
    
  22
Try this FAQ.
 
Don't get me started about those stupid light bulbs.
 
subject: Draging componets like JButtons during runtime in JFrame
 
Similar Threads
D&D Component JFrame to JFrame
JPanel and JFrame listener
I got a problem about JFrame.
To have only one JFrame at a time
pop up window help