Results 1 to 2 of 2
  1. #1
    dharav is offline Member
    Join Date
    Dec 2011
    Posts
    28
    Rep Power
    0

    Question ...---::Graphics HELP! ::---...

    Here is my code and it dosent seem to print a rectangle on the screen, why is that! Can anyone please take a took for me!
    Java Code:
    package dharavsGraphics;
    
    import java.awt.Color;
    import java.awt.Graphics2D;
    import java.awt.Image;
    import java.awt.geom.Rectangle2D;
    import javax.swing.ImageIcon;
    import javax.swing.JFrame;
    import dharavGraphics.Graphics;
    
    public class Main extends JFrame{
    
    
    
    
    	public void paint (Graphics2D g)
    	{
    		Graphics2D ga = (Graphics2D)g;
    
    
    
    		int x=900, y=900;
    
    		Rectangle2D.Double square = new Rectangle2D.Double(10,10,880,880);
    		ga.draw(square);
    		ga.setColor(Color.black);
    	}
    	public static void main(String[] args) 
    
    	{
    		JFrame frame = new Graphics();
    		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    		frame.setSize(900,900);
    		frame.setVisible(true);
    	}
    
    
    }

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is online now Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,243
    Rep Power
    19

    Default Re: ...---::Graphics HELP! ::---...

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. SVG graphics
    By Lacrim in forum Advanced Java
    Replies: 2
    Last Post: 06-09-2012, 12:54 AM
  2. Graphics 2D
    By scopene in forum Java 2D
    Replies: 0
    Last Post: 03-26-2012, 01:21 AM
  3. Graphics g
    By fatabass in forum New To Java
    Replies: 9
    Last Post: 12-25-2011, 12:22 AM
  4. Drawing a graphics onto another Graphics ?
    By Ziden in forum Java Applets
    Replies: 0
    Last Post: 01-08-2011, 07:30 PM
  5. Help with 2d graphics please
    By xbox_nutter in forum New To Java
    Replies: 0
    Last Post: 04-02-2009, 11:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •