1,105,633 Community Members

setSize over time

Member Avatar
TIM_M_91
Junior Poster in Training
92 posts since Feb 2012
Reputation Points: -3 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
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);
   

}
Member Avatar
JamesCherrill
... trying to help
10,387 posts since Apr 2008
Reputation Points: 2,081 [?]
Q&As Helped to Solve: 1,752 [?]
Skill Endorsements: 47 [?]
Moderator
Featured
 
0
 

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

Member Avatar
DavidKroukamp
Master Poster
737 posts since Dec 2011
Reputation Points: 105 [?]
Q&As Helped to Solve: 180 [?]
Skill Endorsements: 4 [?]
Team Colleague
Featured
 
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?

Member Avatar
TIM_M_91
Junior Poster in Training
92 posts since Feb 2012
Reputation Points: -3 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
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

Member Avatar
JamesCherrill
... trying to help
10,387 posts since Apr 2008
Reputation Points: 2,081 [?]
Q&As Helped to Solve: 1,752 [?]
Skill Endorsements: 47 [?]
Moderator
Featured
 
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.

Member Avatar
TIM_M_91
Junior Poster in Training
92 posts since Feb 2012
Reputation Points: -3 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
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?

Member Avatar
JamesCherrill
... trying to help
10,387 posts since Apr 2008
Reputation Points: 2,081 [?]
Q&As Helped to Solve: 1,752 [?]
Skill Endorsements: 47 [?]
Moderator
Featured
 
0
 

There are loads of examples and tutorials on the web. Just Google

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: