ArcMedia JavaScript Source Code 3000 Pro (gar448) for PC Logo

Related Topics:

Posted on Feb 07, 2009

Java source code

I want a java sourse code for systech transpotation service

1 Answer

Anonymous

Level 1:

An expert who has achieved level 1.

  • Contributor 1 Answer
  • Posted on Feb 11, 2009
Anonymous
Contributor
Level 1:

An expert who has achieved level 1.

Joined: Feb 11, 2009
Answers
1
Questions
0
Helped
509
Points
1

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
//package optimalcluster;
/**
*
* @author CSEEXAM2008
*/
import java.awt.*;
import java.awt.geom.*;
import javax.swing.*;
public class GraphingData extends JPanel {
double[] data = {
0.504782921308152, 1.174144134378306, 2.0933754535558546,6.2625807939548823,8.8484441414277364,10.0000003,12.908978000,14.8906789456,12.9087654567 };
final int PAD = 20;
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D)g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
int w = getWidth();
int h = getHeight();
// Draw ordinate.
g2.draw(new Line2D.Double(PAD, PAD, PAD, h-PAD));
// Draw abcissa.
g2.draw(new Line2D.Double(PAD, h-PAD, w-PAD, h-PAD));
double xInc = (double)(w - 2*PAD)/(data.length-1);
double scale = (double)(h - 2*PAD)/getMax();
// Mark data points.
g2.setPaint(Color.red);

for(int i = 0; i < data.length; i++) {
double x = PAD + i*xInc;
double y = h - PAD - scale*data[i];
g2.fill(new Ellipse2D.Double(x-2, y-2, 4, 4));

}
g2.setPaint(Color.black);
for(int i = 0; i < data.length; i++) {
double x = PAD + i*xInc;
double y = h - PAD - scale*data[i];
g2.fill(new Ellipse2D.Double(x-2+4, y-2+4, 4, 4));
}
g2.setPaint(Color.blue);

for(int i = 0; i < data.length; i++) {
double x = PAD + i*xInc;
double y = h - PAD - scale*data[i];
g2.fill(new Ellipse2D.Double(x-2+6, y-2+6, 4, 4));
}
g2.setPaint(Color.pink);

for(int i = 0; i < data.length; i++) {
double x = PAD + i*xInc;
double y = h - PAD - scale*data[i];
g2.fill(new Ellipse2D.Double(x-2+8, y-2+8, 4, 4));
}

}
private double getMax() {
double max = -Integer.MAX_VALUE;
for(int i = 0; i < data.length; i++) {
if(data[i] > max)
max = data[i];
}
return max;
}
public static void main(String[] args) {
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.add(new GraphingData());
f.setSize(400,400);
f.setLocation(200,200);
f.setVisible(true);
}
}

Add Your Answer

×

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1helpful
4answers

Java is not working

Hello there :
first you are going to want to ensure that your your current version of java is installed correctly and is not corrupted and if it needs to be reinstalled
download the latest java version and reinstall this . www.java.com
this should be able to take care of the problem that you are having ok?
best regards michael
2helpful
2answers

Source code in java that display bio data

program that display first name and second name
1helpful
1answer

I need java source code for chat application reply

Your answer is here:
Solution # 1
http://www.web-tech-india.com/software/jsp_chat.php

Solution # 2
http://www.topshareware.com/java-source-codes-for-chat-application/downloads/1.htm

Solution # 3
http://www.codeproject.com/KB/java/java_applet_chat_with_gui.aspx

Good luck
0helpful
1answer

Domain service management system

I know some useful websites full of java source code,so I suggest you to check them, I hope they could help:
www.java2s.com www.sun.com/software/opensource/java/ www.planet-source-code.com/ www.freejavaguide.com/javasource.htm www.javadb.com
Good luck

0helpful
1answer

Can u give me example of source code of filing system in java?

Dear friend these websites are full of java source I hope they could help you:
www.java2s.com/
www.sun.com/software/opensource/java/
www.planet-source-code.com/
www.freejavaguide.com/javasource.htm

Good luck
1helpful
2answers

Java source code for detecting phone call

hello Asda

First things first:
1) Check the online manual for JAVA aplication, it tell all those codes you need.
Carl
http://java.sun.com/docs/books/tutorial/
Not finding what you are looking for?

519 views

Ask a Question

Usually answered in minutes!

Top ArcMedia Computers & Internet Experts

Rob Hill
Rob Hill

Level 3 Expert

1480 Answers

 Mikey
Mikey

Level 3 Expert

6904 Answers

Are you an ArcMedia Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...