Results 1 to 3 of 3
  1. #1
    rachyrach is offline Member
    Join Date
    Apr 2011
    Posts
    1
    Rep Power
    0

    Unhappy How to set background color in User Interface?

    I'm making a name printer thing and this is the code I've been given for the method:

    public void drawNameTag(){
    String name = UI.askString("What name do you want on your tag?");
    UI.clearGraphics(); // clears the graphics pane
    UI.drawOval(200, 100, 200, 150); // draws the outline of a rectangle
    UI.drawString("Hi I'm", 120, 135); // puts the string near the top
    UI.drawString(name, 150, 180); // puts the name near the center


    How do I set the background color in the Oval?

    It must be something like:

    UI.setBackgroundColor(Color.blue) :confused:

    I've tried variations of that and it doesn't work

    :(

  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    What is UI?

    I'd also like to point out that there is a drawRect method you can use instead of drawing an oval.

  3. #3
    jasonwucinski is offline Member
    Join Date
    Feb 2011
    Posts
    64
    Rep Power
    0

    Default

    i think you can use fillOval instead of drawoval. takes the same parameters. at least you can in a canvas

Similar Threads

  1. Change BufferedImage background color
    By Nosrettap in forum New To Java
    Replies: 0
    Last Post: 03-20-2011, 11:29 PM
  2. Changing background color
    By nikkka in forum New To Java
    Replies: 4
    Last Post: 03-12-2011, 05:54 AM
  3. Background color of window
    By Annie George in forum NetBeans
    Replies: 1
    Last Post: 09-18-2010, 09:52 AM
  4. background color with jpanel
    By hannerz06 in forum New To Java
    Replies: 6
    Last Post: 03-31-2010, 03:25 AM
  5. window background color?
    By javan00b in forum New To Java
    Replies: 3
    Last Post: 01-29-2008, 10:43 AM

Tags for this Thread

Posting Permissions

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