Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

the color red is filling my Arc

Posted on 2006-11-16
3
Medium Priority
?
215 Views
Last Modified: 2011-10-03
I have aproblem, the color red is filling my Arc, which should show up blue, What is the correct way of placing the line so I will have a red circle and a blue Arc, I have tried>>  cira.fillArc (xa,ya,100, 110, 50, 75, 45, 215);  but no go?
 Thank you

class Circle extends JPanel {
     public void paintComponent(Graphics g) {
            Graphics cir = (Graphics) g;
            cir.setColor(Color.red);
            Graphics cira = (Graphics) g;
 FlowLayout bar = new FlowLayout();
          int x = 55;
          int y = 55;
         int xa = 55;
          int ya = 55;
          int width = getSize().width - 100;
          int height = getSize().height - 100;
          int diameter = Math.min(width, height);
         cir.fillOval(x, y,diameter,diameter);
              cira.fillArc (100, 110, 50, 75, 45, 215);
              cira.setColor(Color.blue);
             
0
Comment
Question by:charliebaby
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 24

Expert Comment

by:sciuriware
ID: 17963155
Have you already swapped the last 2 lines?

;JOOP!
0
 
LVL 24

Accepted Solution

by:
sciuriware earned 2000 total points
ID: 17963157
That is:

            cira.setColor(Color.blue);
            cira.fillArc (100, 110, 50, 75, 45, 215);

;JOOP!
0
 

Author Comment

by:charliebaby
ID: 17963184
Well I guess I tried everything but the obvious , cause that did the trick,thank you so much.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question