954,545 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Copy and paste Components

Well, i searched all through google and stuff...but in vain..i want to add a functionality in my program to copy and paste buttons which are present on the screen.....I got a wonderful article to copy and paste text.but what about some swing components???????how do we copy and paste them?????

[site]http://www.cafeaulait.org/course/week13/[/site]

jigvesh
Light Poster
44 posts since Oct 2004
Reputation Points: 10
Solved Threads: 0
 

Use the ClipBoard?

server_crash
Postaholic
2,111 posts since Jun 2004
Reputation Points: 113
Solved Threads: 20
 

are you talking about cutting and pasting complete swing components, like buttons and panels?

hooknc
Posting Whiz in Training
219 posts since Aug 2005
Reputation Points: 11
Solved Threads: 8
 
are you talking about cutting and pasting complete swing components, like buttons and panels?

Oh Yeah........something which enables the users to copy and paste the buttons which are present on the interface itself........

jigvesh
Light Poster
44 posts since Oct 2004
Reputation Points: 10
Solved Threads: 0
 

This is a difficult problem. What is your main goal? Are you trying to build a gui editor?

Just shooting from the hip, but I would think that you would want to create your own buttons that extend the normal components and then extend the current java cut and paste utility. Maybe have an interface called Copyable or something like that and then have the new cut and paste utility look for components that are copyable and go from there...

hooknc
Posting Whiz in Training
219 posts since Aug 2005
Reputation Points: 11
Solved Threads: 8
 
This is a difficult problem. What is your main goal? Are you trying to build a gui editor?

Oh yes its something like a GUI editorJust shooting from the hip, but I would think that you would want to create your own buttons that extend the normal components and then extend the current java cut and paste utility. Maybe have an interface called Copyable or something like that and then have the new cut and paste utility look for components that are copyable and go from there...From all that's written here, i have created my buttons and can drag and drop them too..........and frankly the explanation u gave seemed a bit of greek to me.....I'll be grateful to u if u culd explain it in a bit simpler way.......Thanks..........

jigvesh
Light Poster
44 posts since Oct 2004
Reputation Points: 10
Solved Threads: 0
 
hooknc
Posting Whiz in Training
219 posts since Aug 2005
Reputation Points: 11
Solved Threads: 8
 
http://java.sun.com/docs/books/tutorial/uiswing/misc/dnd.html

Thanks a tonne dude.....Now let me work it out.....

jigvesh
Light Poster
44 posts since Oct 2004
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You