Total members 11893 |It is currently Tue Nov 05, 2024 12:30 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Draw Dashed Oval in java
Code:
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.geom.*;

public class DrawDashedOval extends JApplet {
  public void init() {
    setBackground(Color.white);
   }
   float fl[] = { 12.0f };
   BasicStroke basicStroke = new BasicStroke(2.0f,
   BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 12.0f,
      fl, 0.0f);
 
   public void paint(Graphics g) {
    Graphics2D g2d = (Graphics2D) g;
    g2d.setPaint(Color.gray);
    g2d.setStroke(basicStroke);
    g2d.draw(new Ellipse2D.Double(50, 50, 250, 250));
   }
   public static void main(String args[]) {
    JFrame frame = new JFrame("Show Dashed Oval");
    DrawDashedOval dashedOval= new  DrawDashedOval();
    frame.getContentPane().add("Center", dashedOval);
    dashedOval.init();
  frame.setSize(350, 350);
    frame.setVisible(true);
  }
}





Attachments:
File comment: draw dashed oval output
dashedOval.gif
dashedOval.gif [ 6.05 KiB | Viewed 5543 times ]

_________________
M. S. Rakha, Ph.D.
Queen's University
Canada
Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Draw Dashed Oval in java
 draw Oval in java     -  
 Draw Oval,Arc,Polygon,string,Line,Round and 3D Rectangle     -  
 Add dashed border to text div     -  
 Draw An Arc in java     -  
 draw Calendar in java     -  
 Draw Flag in Java     -  
 draw text effects in java     -  
 Changing the color of a graph draw in java     -  
 Java code to draw shortest path tree     -  
 draw cube 3d java-Cube 3D     -  



Topic Tags

Java Graphics
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com