Dj Lee

Greenhorn
+ Follow
since Apr 14, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dj Lee

Paul Clapham wrote:Sounds to me like using a big number causes most of the 10 circles to be located outside of the box displayed in your panel.



the panel is running in (600, 600) so isnt it suppose to show all the circles since I set the diameter of the circle to not exceed 600?
12 years ago
I've made a hi-lo guessing game and I'm having trouble with the play again function using the loop.

Here's my code:


line 59 to 73 is where I inserted the play again function.

If the user correctly guesses the number right, the program prints "Play again? Y or N?" twice...
and I'm allowed to enter an input but it just loops through "play again? y or n?" instead of actually starting the program again.

What am I doing wrong?
12 years ago
Hello, I'm a beginner in Java and I'm trying to create a jpanel that
creates 10 concentric circles with random radius. But I'm having a bit trouble with it.

Here are my codes:




When I run this, I get only one circle (sometimes none...)
if i set radius = generator.nextInt(MAX_DIAMETER) + 1;

But if i replace MAX_DIAMETER which is 600, to something small maybe 100.
radius = generator.nextInt(100)+1;
than i get 5-10 circles...

What am i doing wrong??
12 years ago