Solved

the color red is filling my Arc

Posted on 2006-11-16
3
207 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
Comment Utility
Have you already swapped the last 2 lines?

;JOOP!
0
 
LVL 24

Accepted Solution

by:
sciuriware earned 500 total points
Comment Utility
That is:

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

;JOOP!
0
 

Author Comment

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

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
What is the compatible hibernate version for spring 4.3.1 10 59
powerN  challenge 3 47
endX challenge 2 48
parentbit challenge 3 51
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
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.

744 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

10 Experts available now in Live!

Get 1:1 Help Now