that is i've got an array of buttons and i want to replace two buttons (their location on the screen) by clicking on first and then clicking on the second to replace thier location i.e. when i click on button1 first (which is at the first location in a row of buttons on the screen) and then button5, then these two button should replace locations i.e. after clicking on button5 at the fifth location in a row of buttons button5 goes to the location of button1 and button1 goes to the location of button5.

Is there any way that i can do this without replacing their captions with each other as currently i can swap them by swapping thier captions.

Recommended Answers

All 3 Replies

If you are using breezy swing (not sure if it works on standard swing):

just use the setLocation() method with the appropraite button object.

ex

myButton.setLocation(1,1);

explain more ... what layout are you using ??

thanks for your reply but i have already sorted it out therefore i have unsbscribed from this thread.
many thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.