The Artima Developer Community
Sponsored Link

Java Answers Forum
Help please

1 reply on 1 page. Most recent reply: Aug 15, 2004 9:25 PM by mausam

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Bob

Posts: 1
Nickname: john86
Registered: Aug, 2004

Help please Posted: Aug 11, 2004 8:29 PM
Reply to this message Reply
Advertisement
I have an application that i want to make.

A window opens containing a circle with radius initially 5 pixels and with the x-coordinate of its centre randomly chosen in the range 50 to 342 pixels and the y-coordinate of its centre randomly chosen in the range 50 to 218 pixels. The colour of the circle is randomly chosen
from the colours red, blue, green, magenta and yellow. The circle immediately.

I have completed all of this part but i am having trouble with the following part. I am not sure if you should use a while loop for the whole thing?

It starts to grow at the rate of 1 pixel every 20 milliseconds until the edge of the circle first touches one of the four borders of the display area. At this point
the circle stops expanding and stays unchanged for 500 milliseconds, then the whole process is repeated.


mausam

Posts: 243
Nickname: mausam
Registered: Sep, 2003

Re: Help please Posted: Aug 15, 2004 9:25 PM
Reply to this message Reply
javax.swing.Timer timer = new javax.swing.Timer(20, new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent ae)                   
{
  //DO ur stuff
  //Like increase ur radius.
  //or stop timer
	
				}
	  		});
timer.setRepeats(true);
timer.start();
 
 

Flat View: This topic has 1 reply on 1 page
Topic: New Java RDBMS Previous Topic   Next Topic Topic: iContract Home Web Page

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use