A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Take Control of Upgrading to Yosemite
Take Control of Automating Your Mac
this week in the
Swing / AWT / SWT
Using mouseClicked in swing
Joined: Jan 29, 2010
Jan 29, 2010 05:18:33
I want to move
one step to the left , right, up and down when i click on the
Can any one help me in this?
Joined: Jun 09, 2003
Jan 29, 2010 11:27:23
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
Joined: Oct 27, 2005
Jan 29, 2010 13:02:54
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 - OCEEJBD 6
How To Ask Questions
How To Answer Questions
I agree. Here's the link:
subject: Using mouseClicked in swing
what layouts to use
Using swing for board game.
Can I distinguish JButtons?
Key Events firing for non displayed controls
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014