plotting a graph

plotting a graph

View Answers

August 25, 2008 at 7:43 PM

Hi friend,

import java.awt.*;
import java.applet.*;

public class example1 extends Applet {
Button button1;
public void init() {
}

public void paint(Graphics g) {
Button button1 = new Button("Plot");
add(button1);
g.setColor(Color.blue);
g.drawLine(600,0,600,1000); // x-axis
g.drawLine(0,350,1400,350);// y-axis

for (int i=0;i<=1000;i++){
g.drawLine(i,(int)Math.sin(i),i + 2,(int)Math.sin(i));
//even tho at random location
}
}
}

--------------------------------------

<HTML>
<BODY>
<div align = "center">
<APPLET CODE = "example1.class" WIDTH = "500" HEIGHT = "400"></APPLET>
</div>
</BODY>
</HTML>

-----------------------------



Read for more information.

http://www.roseindia.net/java/

Thanks.









Related Tutorials/Questions & Answers:
plotting a graph - Java Beginners
plotting a graph  pls help me out regarding plotting a graph. I have done that through LiveGraph API. but now i required the graph to be displayed on the gui- window. and whatever inputs i will pass it must change the graph
reading data from excel file and plotting graph
reading data from excel file and plotting graph  I am doing a project using NetBeans in which i have to take input an excel file and then using... excel to plot on an axis in graph
Advertisements
ModuleNotFoundError: No module named 'plotting'
ModuleNotFoundError: No module named 'plotting'  Hi, My Python... 'plotting' How to remove the ModuleNotFoundError: No module named 'plotting... to install padas library. You can install plotting python with following
ModuleNotFoundError: No module named 'outlier-plotting'
ModuleNotFoundError: No module named 'outlier-plotting'  Hi, My... named 'outlier-plotting' How to remove the ModuleNotFoundError: No module named 'outlier-plotting' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'unified-plotting'
ModuleNotFoundError: No module named 'unified-plotting'  Hi, My... named 'unified-plotting' How to remove the ModuleNotFoundError: No module named 'unified-plotting' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'backtrader-plotting'
ModuleNotFoundError: No module named 'backtrader-plotting'  Hi, My... named 'backtrader-plotting' How to remove the ModuleNotFoundError: No module named 'backtrader-plotting' error? Thanks   Hi
Plotting equations on a cartesian Plane
Plotting equations on a cartesian Plane  Hey, Im sort of a beginner of java, and i at the moment of working on a program that takes the input... struggling to figure out how to plot a line graph after the user has input his
plotting of points inside a rectangle
plotting of points inside a rectangle  I want to plot various points inside a rectangle such that any two points are at a distance of at least 3 units from each other. I want all possible configurations that are possible.For
ModuleNotFoundError: No module named 'qcb-plotting-tools'
ModuleNotFoundError: No module named 'qcb-plotting-tools'  Hi, My... named 'qcb-plotting-tools' How to remove the ModuleNotFoundError: No module named 'qcb-plotting-tools' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'elsa-plotting-wand'
ModuleNotFoundError: No module named 'elsa-plotting-wand'  Hi, My... named 'elsa-plotting-wand' How to remove the ModuleNotFoundError: No module named 'elsa-plotting-wand' error? Thanks   Hi, In your
to show graph
to show graph  by clicking on submit button how to show the graph by fetching data in mysql?   Please visit the following link: JSP graph by fetching data in mysql
Version of commons-graph>commons-graph dependency
List of Version of commons-graph>commons-graph dependency
line graph
line graph  I have developed an application and in that i have to compare 2 reports using line graph from the data taken from ms access database?please help
Applet Graph
columns-names by using check box and click on graph button, 3..then i have to get a graph between those columns in a applet plz send me the code thank u
Autoupdating graph
Autoupdating graph  Hey Anyone who might help me making a XY graph, that autoupdates lets say every 5th minute. All the datasets comes from an mySQL database, and the dataset in the database, comes from a txt file and are being
Graph
ModuleNotFoundError: No module named 'graph'
ModuleNotFoundError: No module named 'graph'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'graph' How to remove the ModuleNotFoundError: No module named 'graph'
ModuleNotFoundError: No module named 'graph'
ModuleNotFoundError: No module named 'graph'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'graph' How to remove the ModuleNotFoundError: No module named 'graph'
Graph in JAVA SWING
Graph in JAVA SWING  Hi, How to draw a simple GRAPH in JAVA SWING ?  ..., Please visit the following link: Bar Graph in Java Swing Thanks
Version of com.daedafusion>graph dependency
List of Version of com.daedafusion>graph dependency
What is Graph Database
What is Graph Database  Hi, What is Graph Database? Thanks   Graph Database? Graph Database is special kind of database which is used to store graph data formats. It provides API for saving the graph data into Graph
What is Graph Database
What is Graph Database  Hi, What is Graph Database? Thanks   Graph Database? Graph Database is special kind of database which is used to store graph data formats. It provides API for saving the graph data into Graph
Line Graph using JFreeChart
Line Graph using JFreeChart  I need to draw a line graph of the (no. of sales made on y axis) by a shop with (dates on x axis) using data from MySQL database and JFreeChart
Artifacts of commons-graph
List of Artifacts of commons-graph maven depenency
about graph - Applet
about graph  How to draw a graph in applet and that should be display in web browser? How to make a running applet in our browser? for example ticker
plot a graph in Java
plot a graph in Java   I need to plot a graph in Java but the samples are not known in advance. The samples keep on coming through callback and I... and the final graph may be quite congested. So please guide me on this. Thanks
janusgraph clear graph
developed it is filled with all junk data. I want do clear my graph by deleting... with following query: JanusGraphFactory.drop(graph) This will delete all data and schema of graph database. Thanks
Maven Repository/Dependency: commons-graph | commons-graph
Maven Repository/Dependency of Group ID commons-graph and Artifact ID commons-graph. Latest version of commons-graph:commons-graph dependencies. # Version Release Date You can read more
Changing 2D graph using slider.
Changing 2D graph using slider.  Code for changing a 2d graph with help of slider
datewise/monthwise bar graph
datewise/monthwise bar graph  How to make a datewise/monthwise bar graph using the values from the ms access database? please help its urgent
Create Bar graph
Create Bar graph  hi............. In my project i want to create a BAR GRAPH to display the result. I HAVE certain values that want to show in graph form. Can u help me plzzzzzzz i require a very simple code in java swings were
Line Graph using JFreeChart
Line Graph using JFreeChart  I need to draw a line graph of the (no. of sales made on y axis) by a shop with (dates on x axis) using data from MySQL database and JFreeChart. DRIVER: com.mysql.jdbc.Driver URL: jdbc:mysql
Line Graph using JFreeChart
Line Graph using JFreeChart  I need to draw a line graph of the (no. of sales made on y axis) by a shop with (dates on x axis) using data from MySQL database and JFreeChart. DRIVER: com.mysql.jdbc.Driver URL: jdbc:mysql
Maven Dependency commons-graph >> 0.8
You should include the dependency code given in this page to add Maven Dependency of commons-graph >> commons-graph version0.8 in your project
Maven Dependency commons-graph >> 0.8.1
You should include the dependency code given in this page to add Maven Dependency of commons-graph >> commons-graph version0.8.1 in your project
Version of com.qwazr>qwazr-graph dependency
List of Version of com.qwazr>qwazr-graph dependency
Version of com.ncona>conversion-graph dependency
List of Version of com.ncona>conversion-graph dependency
Version of com.seancheatham>graph-core_2.11 dependency
List of Version of com.seancheatham>graph-core_2.11 dependency
ModuleNotFoundError: No module named 'argparse-graph'
ModuleNotFoundError: No module named 'argparse-graph'  Hi, My... named 'argparse-graph' How to remove the ModuleNotFoundError: No module named 'argparse-graph' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'cocoapods-graph'
ModuleNotFoundError: No module named 'cocoapods-graph'  Hi, My... named 'cocoapods-graph' How to remove the ModuleNotFoundError: No module named 'cocoapods-graph' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'cocoapods-graph'
ModuleNotFoundError: No module named 'cocoapods-graph'  Hi, My... named 'cocoapods-graph' How to remove the ModuleNotFoundError: No module named 'cocoapods-graph' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'company-graph'
ModuleNotFoundError: No module named 'company-graph'  Hi, My... 'company-graph' How to remove the ModuleNotFoundError: No module named 'company-graph' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'cprofile_graph'
ModuleNotFoundError: No module named 'cprofile_graph'  Hi, My... named 'cprofile_graph' How to remove the ModuleNotFoundError: No module named 'cprofile_graph' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'doit-graph'
ModuleNotFoundError: No module named 'doit-graph'  Hi, My Python... 'doit-graph' How to remove the ModuleNotFoundError: No module named 'doit-graph' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'dse-graph'
ModuleNotFoundError: No module named 'dse-graph'  Hi, My Python... 'dse-graph' How to remove the ModuleNotFoundError: No module named 'dse-graph' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'graph-articulations'
ModuleNotFoundError: No module named 'graph-articulations'  Hi, My... named 'graph-articulations' How to remove the ModuleNotFoundError: No module named 'graph-articulations' error? Thanks   Hi
ModuleNotFoundError: No module named 'graph-tool'
ModuleNotFoundError: No module named 'graph-tool'  Hi, My Python... 'graph-tool' How to remove the ModuleNotFoundError: No module named 'graph-tool' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'graph-tool'
ModuleNotFoundError: No module named 'graph-tool'  Hi, My Python... 'graph-tool' How to remove the ModuleNotFoundError: No module named 'graph-tool' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'graph-wrap'
ModuleNotFoundError: No module named 'graph-wrap'  Hi, My Python... 'graph-wrap' How to remove the ModuleNotFoundError: No module named 'graph-wrap' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'jlvandenhout-graph'
ModuleNotFoundError: No module named 'jlvandenhout-graph'  Hi, My... named 'jlvandenhout-graph' How to remove the ModuleNotFoundError: No module named 'jlvandenhout-graph' error? Thanks   Hi, In your

Ads