Oct 30, 2007 #1 Jroyal Programmer Oct 24, 2006 9 GB Code: for (int x=0; x<2000; x++) { datafield1.setLocation(luckyjbox.getX()+x, luckyjbox.getY()); datafield1.updateUI(); } I want it to animate, so that the jtextfield moves from one position to the next one pixel at a time. why isnt it working?
Code: for (int x=0; x<2000; x++) { datafield1.setLocation(luckyjbox.getX()+x, luckyjbox.getY()); datafield1.updateUI(); } I want it to animate, so that the jtextfield moves from one position to the next one pixel at a time. why isnt it working?
Oct 30, 2007 #2 Diancecht Programmer Jan 8, 2004 4,042 ES Who knows ... What's luckybox? What do you mean by "it's not working"? Cheers, Dian Upvote 0 Downvote
Oct 30, 2007 Thread starter #3 Jroyal Programmer Oct 24, 2006 9 GB jluckybox is just a ordenary Jtextfield. datafield1 is a jtextfield, datafield1.setLocation( param, param ); sets the location of the datafield1 to the specified X and Y cordinates. now all i want to do is add one each time to say X and see the jtextfield move.. Upvote 0 Downvote
jluckybox is just a ordenary Jtextfield. datafield1 is a jtextfield, datafield1.setLocation( param, param ); sets the location of the datafield1 to the specified X and Y cordinates. now all i want to do is add one each time to say X and see the jtextfield move..
Oct 30, 2007 #4 Diancecht Programmer Jan 8, 2004 4,042 ES And what's happening? Cheers, Dian Upvote 0 Downvote
Oct 31, 2007 Thread starter #5 Jroyal Programmer Oct 24, 2006 9 GB i want to move the jtextfield on pixel to the left to simulate this: http://www.cs.oswego.edu/~mohammad/classes/csc241/samples/sort/Sort2-E.html but i am using Jtextfield for the databoxes. Upvote 0 Downvote
i want to move the jtextfield on pixel to the left to simulate this: http://www.cs.oswego.edu/~mohammad/classes/csc241/samples/sort/Sort2-E.html but i am using Jtextfield for the databoxes.
Nov 29, 2007 #6 GastonSE Programmer Nov 29, 2007 2 MX shouldn't you update the container instead of the jtextfield? Upvote 0 Downvote
Dec 7, 2007 #7 jstreich Programmer Apr 20, 2002 1,067 US Yeah, you need to invalidate the container/panel so it gets redrawn. [plug=shameless] http://game-master.us/phpx-3.4.0/[/plug] Upvote 0 Downvote
Yeah, you need to invalidate the container/panel so it gets redrawn. [plug=shameless] http://game-master.us/phpx-3.4.0/[/plug]