Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML


 
  
 
Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML
 

 
Facing Programming Problem?
Ask Questions?, Browse Latest Questions, Question-Answer Guidelines
Java
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments

Cubic Diagram In Java

                         

Introduction

In this section, you will learn  how to create Cubic diagram. The Java2D API  provides you several classes that defines common Geometry object as a coordinate component. The Java Drawing program depends on the Java2D API class, and this class is support by the "java.awt.geom" package.

Program Description:

In this program, We are using CubicCurve2D class for cubic curve component. The CubicCurve2D class creates a cubic diagram. The CubicCurve2D class also implements the shape interface. We are going to use cubicCurve2D Class to define a cubic parameter as a (x ,y) coordinate and this class  is only the abstract superclass for all objects which is stored in a 2D cubic curve segment.

In this program we are passing  parameter like (x1, y1, ctrlx1 , ctrly1,  ctrlx2, ctrly2,  x2,  y2) as a coordinate space. The parameter are defined to set cubic diagram point x-axis and y-axis direction and the ctrlx1 or ctrly1 sets the x and y axis. All the parameters are explained below :

x1- The x1 point is the x coordinate used to set the start point of this cubicCurve2D
y1- A y1point  is the used for y coordinate to set the start point of this cubicCurve2D
ctrlx1- The ctrl x coordinate is used to set the first control point of this cubicCurve2D
ctrl y1- A ctrl y coordinate is used to set the first control point of this cubicCurve2D
ctrlx2- the ctrl x coordinate to set the second control point of this cubicCurve2D.
ctrly2- The ctrl y coordinate is used to set the second control point of this CubicCurve2D
x2- A point is the x coordinate used to set the second point of this CubicCurve2D
y2- A point is the y coordinate used to set the second point of this cubicCurve2D.

Here is the code of this program:

import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;

public class Cubic extends Frame{
  Stroke drawingStroke = new BasicStroke(4);
  CubicCurve2D cubic= new  CubicCurve2D.Double(40,1504005300350300180);

  public void paint(Graphics g){
    Graphics2D ga = (Graphics2D)g;
    ga.setStroke(drawingStroke);
    ga.draw(cubic);
    }
  public static void main(String args[]){
    Frame frame = new Cubic();
    frame.addWindowListener(new WindowAdapter(){
      public void windowClosing(WindowEvent we){
        System.exit(0);
      }
    });
    frame.setSize(310300);
    frame.setVisible(true);
  }
}

Output of this program:


  

Download this program.

                         

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Latest Searches:
find out factors of nu
passing value from ser
Struts1.1 example down
bubble sort
rfc
JSP in error page
Display image on JSP p
JScrollPane
Date
how to get the time di
DB2
download package com.s
log4j/
java program to check
conversion of decimal
array java
api struts
linked list and GUI
Designing Star sign sy
SwingWorker
Hibernate Min() Functi
java code for circula
breakâ???â?¬â?¤????â??
jsp table
Java EJB Struts Hibern
list box from database
text color
jstl list size
placeholder
create file folder
drill down
Tomahawk commandLink t
jpanel
struts2 checkbox
retrieving data from h
Html tag inside out im
regularexpression
jsf validator
hibernate findall
Icon
Telephony
code to add and retriv
Flash Navigation Drop
diffreence between ser
how to configure msacc
s:If Struts2
access bean properties
'string variable in sw
Reading File into Byte
jsf node set href
jsp bean get property
javascript connect db
sun.jdbc.odbc.JdbcOdbc
Applet event button
Insert Data into Datab
JTree Open Icon
concatenate java
clear the console in j
for loop
download struts applic
jasper report
java display applet me
servlet exception hand
code for how connect j
struts-config
java program examples
jsp to jdbc codes
<SELECT> and Post
ล ยà¸?ฤ??????à¸
getter setter methods
c:out in var of c:fore
upload file using ajax
Flex TreeGrid
Photoshop Drawing Penc
Quartz
Java / multi thread
ASP Ad Management Crea
insert data to text fi
example
factory method
Java String toLowerCase Example
Java String toCharArray Example
Java String substring Example
Java String indexOf Example
Java String startsWith Example
Java String hashCode Example
Java String matches Example
Java String length Example
Java String lastIndexOf Example
Java String isEmpty Example
Java String equalsIgnoreCase Example
Java String equals Example
Java String endsWith Example
Java String copyValueOf Example
Java String contentEquals Example
  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.