Results 1 to 2 of 2
- 03-02-2009, 05:47 AM #1
Member
- Join Date
- Dec 2008
- Posts
- 10
- Rep Power
- 0
Having trouble understanding Class Graphic
Ok, i am trying to draw circles with a circle object on a jFrame with the input of the user taken with the scan.nextDouble() method, I am in way over my head sadly and I am doing things without fully understanding them. I have only just begun doing graphic, when i say begun we just learned how to make a jFrame. So am i here to ask you for help in understanding
A. how do use an can i use an Abstract class like Graphic with initializing it. i need to use the method circle.getAbscisse() getRadius etc...Any help would be appreciated.
Most of this code comes from reading forums and wikis, i understand most of it but I am just confused on how to apply my circles to these methods. Thank you for taking the time to readJava Code:/** * @(#)MyCanvas.java * * MyCanvas application * * @author * @version 1.00 2009/3/1 */ import java.util.Scanner; import java.awt.*; import javax.swing.*; public class MyCanvas extends Canvas { public static void main(String[] args) { //System.out.println("Enter the x,y an radius values"); //Scanner scan = new Scanner(System.in); //Cercle cerc = new Cercle(scan.nextDouble(),scan.nextDouble(),scan.nextDouble()); MyCanvas canvas = new MyCanvas(); JFrame frame = new JFrame(); frame.setSize(800, 800); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(canvas); frame.setVisible(true); //Graphics graphics; //graphics.drawLine(10, 20, 300, 310); } public MyCanvas() { } public void paint(Graphics graphics) { graphics.setColor(Color.white); graphics.fillOval(10,10,25,25); graphics.setColor(Color.blue); graphics.drawOval(10,10,25,25); } }Last edited by Bernard Robitaille; 03-02-2009 at 05:23 PM. Reason: mistakes
- 04-18-2009, 02:55 AM #2Incinsnodgigh Guest
No more hassles for Internet Shoppers!
VeriSupport has launched the world's first SUPPORT RANKING PROGRAM
And it is available now! You can choose to buy from stores which are VeriSupport certified and ranked ensuring that you are protected from online breeches and fraudulent organizations. Look for the VeriSupport seal when you buy from an online store, as VeriSupport seal in a website tells you, the organizations ability to provide support like live customer service, technical support and other helpdesk functions before, during and after the sale; the ability to handle customer feedback and their reliability as a company.
VeriSupport's Support Ranking Program provides a number of benefits to you including:
1. You can be confident that there is a support channel for addressing your issues and concerns
2. You have the power to comment and rate in real-time about your experience
3. You can be confident that you are dealing with a reliable business
4. Assurance that transactions are secure
VeriSupport helps your visualize support levels of the organization that you could deal with! and now its your decision choose VeriSupport certified organization for a hassle free experience!
Look for the VeriSupport seal provided by VeriSupport.Com, every time!
Similar Threads
-
Understanding this recursive function
By LifeWithJava in forum New To JavaReplies: 3Last Post: 12-30-2008, 05:26 AM -
[SOLVED] Trouble understanding or expressions
By hungdukie in forum New To JavaReplies: 1Last Post: 11-23-2008, 01:24 AM -
[SOLVED] Help with understanding nullpointexcepion
By soxfan714 in forum New To JavaReplies: 4Last Post: 11-11-2008, 04:51 AM -
Understand my logic errors and better understanding method and class creation
By freethinker89 in forum New To JavaReplies: 3Last Post: 10-06-2008, 11:03 PM -
Understanding Vectors
By cbrown08 in forum New To JavaReplies: 7Last Post: 11-05-2007, 06:56 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks