Switch to full style
General Java code examples
Post a reply

Draw An Arc in java

Tue Nov 11, 2008 8:45 pm

Draw An Arc in using java
Code:
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.geom.*;

public class 
DrawAnArc extends JApplet {
  
BasicStroke basicStroke = new BasicStroke(5.0f);  
    public 
void paint(Graphics g) {
    
Graphics2D g2d = (Graphics2Dg;
    
g2d.setPaint(Color.red);
    
g2d.setStroke(basicStroke);
    
g2d.draw(new Arc2D.Double(51015015060150,
        
Arc2D.OPEN));
    }
  public static 
void main(String s[]) {
    
JFrame frame = new JFrame("Draw Arc");
    
JApplet applet = new DrawAnArc();
    
frame.getContentPane().add("Center"applet);
    
frame.setSize(300250);
    
frame.show();
  }



Attachments
arc.gif
Draw arc in Java
arc.gif (4.63 KiB) Viewed 15817 times

Post a reply
  Related Posts  to : Draw An Arc in java
 draw Oval in java     -  
 Draw Flag in Java     -  
 draw Calendar in java     -  
 draw text effects in java     -  
 Draw Dashed Oval in java     -  
 Changing the color of a graph draw in java     -  
 Java code to draw shortest path tree     -  
 draw cube 3d java-Cube 3D     -  
 How to draw a gun     -  
 Draw pie chart php     -  

Topic Tags

Java Graphics