Solved

can you give me some direction ?

Posted on 2006-11-16
5
187 Views
Last Modified: 2010-03-31
I am moving along slowly but surly on the code, I need to slice up the Circle on the Pane into 3-4 slices, each with its own color, can you give me some direction ?


class Graph extends JFrame {
     public Graph() {
    super("PIE CHART");
    setSize(500, 500);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setVisible(true);
    Container pane = getContentPane();
     pane.add(new Circle());
     setContentPane(pane);
     setVisible(true);
 }
}

class Circle extends JPanel {
     public void paintComponent(Graphics g) {
Graphics cir = (Graphics) g;
cir.setColor(Color.yellow);
             
 FlowLayout bar = new FlowLayout();
    int x = 55;
    int y = 55;
    int width = getSize().width - 100;
    int height = getSize().height - 100;
    int diameter = Math.min(width, height);
     cir.fillOval(x, y, diameter, diameter);
}
}
}
0
Comment
Question by:charliebaby
  • 3
  • 2
5 Comments
 
LVL 16

Accepted Solution

by:
suprapto45 earned 500 total points
ID: 17961817
0
 

Author Comment

by:charliebaby
ID: 17962231
Thank you, I will do the best I can, that's a start, Charliebaby.
0
 

Author Comment

by:charliebaby
ID: 17962235
Thank you, I will do the best I can, that's a start, Charliebaby.
0
 
LVL 16

Expert Comment

by:suprapto45
ID: 17962243
:).

Get back to us if you found any problem.

David
0
 

Author Comment

by:charliebaby
ID: 17962312
Thank you again David,Charlie.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Application launch issue with Apache Tomcat 5 41
JDeveloper 12c for 32 bit 4 84
Error trying to install RTMT Win7 5 59
use lov values 2 49
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
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 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 how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

785 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