Draw a polygon with two data files given.

I'm trying to draw a polygon in a box with two data files given. The first file is the x-dimension and the second y-dimension respectively. Later this application will be added into a html-page.

The version is included. So could anyone help me to get this base fixed, or solve this problem another way ? Thanks !
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
/* The aim of this applet is to draw a polygon and it will be used
on a html-page. This applet should get two files of data and the size
as parameters.

/*
Here is the revised code -- the main problem was that the method readDataFiles was never called. Now it is explicitly called from init(), but I moved the code that actually draws the lines into the paint method by the box-drawing code. I also made some minor changes in the tokenizing structure -- nothing major.
As to the setting the StreamTokenizers to work from a your hard drive as well as from a URL -- the applet must read from a URL, otherwise it will get a SecurityException when it tries to access your hard drive. However, the getDocumentBase() method always returns the URL the HTML file is at, even if it resides on your hard drive. This means that you don't need to know the URL beforehand, and that the xNumbers and yNumbers parameters only need to specify the corresponding files' locations with respect to the HTML file -- if they are in the same directory, you only need to specify their names, as you did in your example HTML file.
The version shown below should run correctly. Just for reference, I used the example HTML file you gave in your other question and data files as shown below:

Xnumerot.txt

100 200 300 400 300 200 100

Ynumerot.txt

200 300 200 100 300 100 0

If you have any more questions, don't hesitate to ask --
Alexander Wilkins

To be honest I got to admit that my original task was not to draw a polygon but a graph.
I don't know how you call it in english, maybe a polynome or what ? In german they probably say: " Ein Polygonzug" or "Zick Zack".

However, I got this feature done with our polygon by changing the loop of index a little bit, so that the last line is not drawn.

Anyway, I'm still thankful for you help Mr. Wilkins. If you ever need to ask a question conserning mathematical analysis or general thory of expertise, please contact me and maybe I can help you then.

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench.
Introduction
While learning Java can be done with…

Viewers will learn about the different types of variables in Java and how to declare them.
Decide the type of variable desired:
Put the keyword corresponding to the type of variable in front of the variable name:
Use the equal sign to assign a v…

Viewers will learn about basic arrays, how to declare them, and how to use them.
Introduction and definition:
Declare an array and cover the syntax of declaring them:
Initialize every index in the created array:
Example/Features of a basic arr…