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:
- 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
- Display the points. The program will read the point set, determine an appropriate scale, and display the points in a graphics window.
- 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:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started