0

Hi guys what I want to do is set a new setSize which I can do but it just appears. Therefore what I want is for the setSize to move over time instead of just flicker and appear.

Any help would be appriciated:

if (e.getSource() == set) {
    setSize(1000,1000);
   

}
3
Contributors
6
Replies
7
Views
4 Years
Discussion Span
Last Post by JamesCherrill
Featured Replies
  • Use a javax.swing.Timer to execute an actionPerformed method every (eg) 60 millisecs. In each execution of the method increase the size by a small amount (eg 4 pixels). When it reaches the desired size, stop the Timer. Doc and examples for Swing Timer in all the usual places. Read More

0

Hi guys what I want to do is set a new setSize which I can do but it just appears. Therefore what I want is for the setSize to move over time instead of just flicker and appear.

Any help would be appriciated:

if (e.getSource() == set) {
    setSize(1000,1000);
   

}

dont really know if this may help but what about using a for loop and incrementing by say 25 until 1000? and maybe the flickering will lessen?

Edited by DavidKroukamp: n/a

0

Do you mean that you want the component to grow "slowly", like an animation?

Thats what I mean't sorry if I didn't explain clearly

1

Use a javax.swing.Timer to execute an actionPerformed method every (eg) 60 millisecs. In each execution of the method increase the size by a small amount (eg 4 pixels). When it reaches the desired size, stop the Timer.
Doc and examples for Swing Timer in all the usual places.

0

Use a javax.swing.Timer to execute an actionPerformed method every (eg) 60 millisecs. In each execution of the method increase the size by a small amount (eg 4 pixels). When it reaches the desired size, stop the Timer.
Doc and examples for Swing Timer in all the usual places.

Could you show an example?

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.