Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Draging componets like JButtons during runtime in JFrame

 
Abhishek Abhinav
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11092
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49776
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 49776
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 49776
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this FAQ.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic