Question: Please help me to solve the problem with java language! Application that can read text files containing lists of points in a two-dimensional space and

Please help me to solve the problem with java language!

Application that can read text files containing lists of points in a two-dimensional space and display those points in a graphics window. The points will be provided as pairs of numbers (integer or floating-point) representing the X (horizontal) and Y (vertical) positions in a Cartesian coordinate system. The first line of the text file will be an integer indicating the number of point positions, N. The next N lines will be a pair of values (one point per line), each value preceded by zero or more spaces with the two values separated by a comma, as shown here:

5 -2, -5 0, 0 5, 60 10, -15 24, 42 

Your program must be able to accomplish the following operations:

  1. Read the text file. The user will be allowed to specify the file name and file path in one of the following ways:
    • As a command-line argument
    • By using a "File Open" dialog box
  2. Display the points. The program will read the point set, determine an appropriate scale, and display the points in a graphics window.
  3. Draw line segments between the points in the order that they appear in the text file.

For example, given the input file shown above, the output of the program could be displayed as follows:

Please help me to solve the problem with java language! Application that

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!