Solved

can you give me some direction ?

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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
hibernate jars 4 57
maven disable workspace resolution 1 37
Using jdbcTemplate.batchUpdate to improve INSERT performance 6 26
junit example issue 2 22
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…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
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 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.

713 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