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
Solved

the color red is filling my Arc

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to add new optional parameter to JSP 1 49
How do I remove an object from a 3 40
going to wrong jsp page 2 33
ejb entity bean example 2 8
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
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…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This video teaches viewers about errors in exception handling.

809 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