Solved

can you give me some direction ?

Posted on 2006-11-16
5
185 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
bunnyEars challenge 6 65
Fibonacci challenge 11 84
word0 challenge 3 58
Starting to learn JAVA, 7 48
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

759 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

21 Experts available now in Live!

Get 1:1 Help Now