Since 1998, Alden Hosting is a provider of business-class Web hosting to small- and medium-sized businesses, providing professional, efficient, and reliable services. We provide everything you need to get your business on the Internet. We make it easy and affordable. Alden Hosting's feature-rich hosting plans and excellent 7 days a week toll-free customer support empower you to efficiently build a Web business that will grow with your changing needs.
web site generation 0; ymin = -1.0; ymax = 1.0; } public void paint(Graphics g) { double x1,y1,x2,y2; int i, j1, j2; j1 = yvalue(0); for (i = 0; i < AppletWidth; i++) { j2 = yvalue(i+1); g.drawLine(i, j1 ,i+1, j2); j1 = j2; } } private int yvalue(int ivalue) { // Given the xpoint we're given calculate the Cartesian equivalent double x, y; int jvalue; x = (ivalue * (xmax - xmin)/(AppletWidth - 1)) + xmin; // Take the sine of that x y = Math.sin(x); // Scale y into window coordinates jvalue = (int) ((y - ymin)*(AppletHeight - 1)/(ymax - ymin)); // Switch jvalue from cartesian coordinates to computer graphics coordinates jvalue = AppletHeight - jvalue; return jvalue; } } Run this applet.
web site generation Isn't that a much nicer looking sine wave? There are still a number of things we can add to make this a more complete applet though. The most important would be to add some parameters so that we can define the size of the applet in HTML. The following modification of the init and paint methods looks for xmin, xmax, ymin, and ymax to be specified via parameters. However for robustness if the author of the HTML forgets to specify them we supply some reasonable default values.import java.
web site generation applet.*; import java.awt.*; public class GraphApplet extends Applet { int x0, xN, y0, yN; double xmin, xmax, ymin, ymax; int AppletHeight, AppletWidth; public void init() { String ParamString; // How big is the applet? Dimension d = size(); AppletHeight = d.height; AppletWidth = d.
web site generation
Web Hosting Links Portal
Web Hosting
JSP Hosting
Tomcat Hosting
MySQL Hosting
servlets Hosting
Web Site Hosting
JSP Hosting
Tomcat Hosting
MySQL Hosting
servlets Hosting
JSP Web Hosting
JSP Web Hosting
Servlet Web Hosting
Servlet Web Hosting
Alden Trading
Alden Shoes
ebootery
Minnetonka Moccasins
myMoccasins
Protecting Your Assets Portal
Offshorelaw links
Offshorelaw
INTERNET LARGEST NEW CAR BUYING SERVICE
Where You will Find every wedding service you will need
Where You will Find every wedding service you will need
unemployment benefit services
unemployment benefit services
unemployment benefit services
Menu Paper
Menu Paper
Dancing Waters
Dancing Waters
web site generation