Solved

the color red is filling my Arc

Posted on 2006-11-16
3
209 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

932 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now