ps6 - 1.124J Foundations of Software Engineering Problem...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
1.124J Foundations of Software Engineering Problem Set 6 Due Date: Thursday 11/2/00 Reference Readings: From Java Tutorial All material from the previous problem set Essential Java Classes: Using String and StringBuffer (recommended) Setting Program Attributes Accessing System Resources Handling Errors with Exceptions (required) Doing Two or More Tasks At Once: Threads (required) Reading and Writing (required) Writing Applets Overview of Applets (required) Taking Advantage of the Applet API (recommended) Practical Considerations when Writing Applets (recommended) Finishing an Applet (recommended) Creating a GUI with JFC/Swing Getting Started with Swing (required) Swing Features and Concepts (required) Using Swing Components (required) Using Other Swing Features (required) Laying Out Components Within a Container Writing Event Listeners (required) Working with Graphics Converting to Swing Java2D Overview of the Java 2D API Displaying Graphics with Graphics2D Stroking and Filling Graphics Primitives
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Problem 1: [60%] In this problem you need to write a Java application to read the x and y coordinates from a file, named data6_1 and make a plot of the values. It is advised to implement the functionality in the introductory part and then start building the program gradually. Introductory Part: An issue that you have to address is the data input from a file. It may be easier if you write the class to open a file and read the values stored in that file and then proceed to the graphical user interface part. You need to write a Java application to read from the file data6_1 the x and y coordinates of points. The file has first the number of points (i.e. couples of x and y values) stored. Your application should be able to open the file, read the values into arrays of double, named x and y, and print out their values. Write a class with a method to achieve this functionality. >java Sol6_1 100 points have been read x[1]=2.5 y[1]=2.5 x[2]=3.0 y[2]=3.0 x[3]=3.5 y[3]=3.5 ............................. Main part: Having implemented the part to read values from a file you should proceed to the design of the graphical user interface. This should be done very gradually to avoid errors and needless waste of time during debugging. You should write part by part, e.g. just a JFrame , then add a JMenuBar , then add a JToolBar , etc., checking each part before proceeding to the next one. Ultimately, you need to write a Java application that will read in values of points from a file and plot a polyline joining those points as shown below, after reading in the values:
Background image of page 2
Initially, the program should have the following look:
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
It should have a menu bar with a menu named File. Under the "File" menu there should be two menu items, as shown below:
Background image of page 4
"Import Data": which should open the file data6_3 and read in the x and y coordinates. The first number in that file is the number of points followed by that number of couples of
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 11

ps6 - 1.124J Foundations of Software Engineering Problem...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online