Solved

can you give me some direction ?

Posted on 2006-11-16
5
191 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
[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
  • 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

617 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