Results 1 to 5 of 5

Thread: bluej help

  1. #1
    xpanhol is offline Member
    Join Date
    Jan 2012
    Posts
    2
    Rep Power
    0

    Default bluej help

    public void run()
    {
    // posiçoes e cores aleatorias
    RandomGenerator gen = new RandomGenerator(); // gerador de números
    int x, y, w, h;
    Color[] bubbleColours = { Color.YELLOW, Color.GREEN,
    Color.RED, Color.BLUE, Color.GRAY, Color.MAGENTA,
    Color.ORANGE, Color.PINK };
    for (int i = 0; i < 20; i++)
    {


    x = gen.nextInt(500);
    y = gen.nextInt(500);
    w = gen.nextInt(500);
    h = gen.nextInt(500);
    GRect r = new GRect(x, y, w, h);
    r.setFilled(true);
    r.setFillColor(gen.nextInt(bubbleColours.length));
    this.pause(1000);
    this.add(r);




    where is the problem????????? help please

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default Re: bluej help

    Quote Originally Posted by xpanhol View Post
    where is the problem????????? help please
    I can't tell because you never tell us. Can you describe what problems you're currently having?

  3. #3
    xpanhol is offline Member
    Join Date
    Jan 2012
    Posts
    2
    Rep Power
    0

    Default Re: bluej help

    the problem is setfillcolor(java.awt.color)in acm.grapichcs.grect cannot be aplplied to(int)

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default Re: bluej help

    The error is telling you that you're trying to call the setFillColor by passing an int into its parameter, but that a method like this doesn't exist -- nor should it, since it doesn't make sense to set the color of something to 3. Instead it's telling you that setFillColor expects a Color to be passed into its parameter. So do that. Change the method call so that you pass a Color in, not an int.

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default Re: bluej help

    Quote Originally Posted by xpanhol View Post
    anybodi have's a Bubble shooter?
    i have a work to do. i only need
    This is unrelated to your original question and shouldn't be in this thread but in its own thread. Also, you appear to be asking for someone to give you code which is not allowed in this forum. I will delete your post above shortly and again invite you to create a new thread for it, but don't ask for code. Rather ask for help with your code.

Similar Threads

  1. BlueJ - UML
    By Nghi97 in forum New To Java
    Replies: 5
    Last Post: 11-28-2011, 11:03 AM
  2. Need help with blueJ
    By samd89 in forum Other IDEs
    Replies: 6
    Last Post: 12-06-2010, 04:59 PM
  3. BlueJ help
    By Cid17 in forum New To Java
    Replies: 2
    Last Post: 06-29-2009, 07:38 PM
  4. help using BlueJ
    By zoe in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 06:07 AM
  5. BlueJ 2.2.0
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 07-07-2007, 02:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •