...---::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!:=(:
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);
}
}
Re: ...---::Graphics HELP! ::---...