I need more if-statement help
I have this code right now. What I'm trying to do is slowly make the circle bigger until it fully covers the background. What I have so far:
import hsa.Console;
import java.awt.*;
public class GamingProject
{
static Console c;
public static void main (String[] args)
{
c = new Console ();
//Beginning words to set background
Font newFont = new Font("Times New Roman",1,20);
c.setFont(newFont);
c.drawString ("Before the quiz begin, we would just like to ask which one",0,15);
c.drawString ("of these colors is your favorite color?",0,30);
c.setColor (Color.blue);
c.fillOval (50,50,50,50);
c.setColor (Color.red);
c.fillOval (125,50,50,50);
c.setColor (Color.green);
c.fillOval (200,50,50,50);
c.setColor (Color.orange);
c.fillOval (275,50,50,50);
c.setColor (Color.black);
c.fillOval (350,50,50,50);
c.setColor (Color.magenta);
c.fillOval (425,50,50,50);
c.setColor (Color.black);
c.drawString ("My favorite colour is: ",0,155);
c.setCursor (8,24);
String backgroundColor;
backgroundColor = c.readLine();
c.clear();
int y = 150;
int x = 215;
if (backgroundColor.equalsIgnoreCase ("blue"))
{
c.setColor (Color.blue);
c.fillOval (215,150,200,200);
for (y = 150; y <=300; y++)
{
c.setColor (Color.blue);
c.fillOval (215, y,20,20);
for (int counter = 0; counter <2147000000; counter++)
{}
}
(I have more code here but it's unnecessary)
The problem is highlighted in red. It says " "}" is inserted to complete Statement No Short If"
What does that mean?
Are there other ways to make my circle grow bigger?
Re: I need more if-statement help
For future reference, please use the code tags (see my signature)
Its best to have full disclosure, and not leave those trying to help with more questions than you have. For instance, what says the following?
Quote:
The problem is highlighted in red. It says " "}" is inserted to complete Statement No Short If"
The compiler? The JRE? Is this something you post into a website to check correctness? What is hsa.Console? It is not part of J2SE.