Total members 10261 | Gratitudes |It is currently Tue May 22, 2012 4:56 pm Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 1 post ] 
Author Code Snippet
 Code subject: Draw Dashed Oval in java
PostPosted: Tue Nov 11, 2008 6:16 pm 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2279
Location: Earth
Has thanked: 39 time
Have thanks: 61 time

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 1133 times ]

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )
TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 1 post ] 
Quick reply


  

 Similar topics
 video chat application in java
 navigating to database using java
 java mobile apps
 need help in java
 Read your gmail using Java code
 Java Programing to communicating port parallel
 Java Chat
 Steganography in java
 java code for listing folder contents from remote folder
 java

All times are UTC [ DST ]


Users browsing similar codes

Users browsing this forum: No registered users and 1 guest



Jump to:  
Previous Code Snippet | Next Code Snippet 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team