Solved

the color red is filling my Arc

Posted on 2006-11-16
3
212 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 500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
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…

749 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