| Author |
Using mouseClicked in swing
|
jagan raja
Ranch Hand
Joined: Jan 29, 2010
Posts: 54
|
|
I want to move JButton one step to the left , right, up and down when i click on the JButton.
Can any one help me in this?
|
 |
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
|
posted

0
|
generally the parent would be a null layout, and you just change the location with the click
left/right change x, up/down change y
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
Check out setLocation. But as Michael said, you need a null layout, or the layout manager will ignore the location you set manually.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
 |
|
|
subject: Using mouseClicked in swing
|
|
|