Introduction
Python,C ++JAVA,。 (n = 10),。
,。 ,(,)。
。 ,。
:
1、,; (10)
2、; (10)
3、; (10)
4、,; (20)
5、。 zip。 (10)
Requirement
Homework 08
Outcomes
use objects.
create Graphical User Interfaces
Write programs that use Files.
Scoring
do not submit a .zip file containing your source code, your score will be zero.
submit source code that does not compile, your score will be zero.
do not submit the JAR file, your score will be zero.
If you submit source code without the corct class name(s) or the correct method
names (see below), your score will be decreased by 50 points.
In addition, deductions will be made for not meeting the following requirements:
o At the beginning of each java file, add a comment with the following
information:
Student’s name
Course/section,
Date
Filename
Description of the program/class
o Indentation guidelines:
The code inside of a class must be indented with respect to the class
definition.
The code inside of a method must be indented with respect to the
method definition.
The code inside of if / else / else if / while / for / do-while structures
must be indented with respect to its corresponding structure.
Curly braces can be positioned at the end of the corresponding
structure definition, or in the following lines aligned with the
corresponding structure.
o Comments:
At least, one-line comment should be added per method or
constructor.
Comments must describe the functionality or objective of the
method.
Please add more comments about your code, if you think that will
help the grader.
Rubric
Full credit Partial credit
Graphical User Interface
(20 points)
You implements the Graphical
User Interface.
You implements the
Graphical User
Interface, but with
some errors.
Button New
(5 points)
You implements the
functionality of the button
New.
You implements the
functionality of the
button New, but with
errors.
Button Load
(30 points)
You implements the
functionality of the button
Load.
You implements the
functionality of the
button Load, but with
errors.
Button Save
(15 points)
You implements the
functionality of the button
Save.
You implements the
functionality of the
button Save, but with
errors.
Button Save as
(30 points)
You implements the
functionality of the button Save
as.
You implements the
functionality of the
button Save as, but
with errors.
Description
This assignment consists of the development of one project. The project should be stored in
its own folder. Submit the project folder in a zip file, named Homework08.zip , to the
corresponding assignment in Canvas.
1Create a project named TextEditor .
2Implement the class TextEditor . This class is a subclass of JFrame. .
3. The objective of this program is to create a text editor. See the following interface:
4. As seen in the picture, there are four buttons:
a. New. This button cleans the text area. Sets the “file in use” to none (null).
i. If a file is in use, this button just ignore it a clean the text area, and
sets the “file in use” to none.
b. Open. This button opens an “open dialog window”, where the user selects a
text file. The text file is uploaded to the text area. Sets the “file in use” to the
file which was selected by the user.
i. If a file is already in use, this button just ignore it an open the
selected text file.
c. Save as. This button open an “save dialog window”, where the user selects a
location and a name for a new text file. The content of the text area is stored
in the new file. Sets the “file in use” to the file which was selected by the
user.
d. Save. If the “file in use” is set to none, this button do the same functionality
like the Save as button. Otherwise, this button writes the content of the text
area to the “file in use”.
5The four buttons are in the North region in the layout.
6Also, the interface includes a text area which is in the Center region.
7. In addition, the interface includes a label which is in the South section. This label
display the “file in use”.
8Implement the class TextEditorTest to test your program.
9. Once the program is running, create a JAR file of the program.
Submission
The zip file must contain:
Eclipse project folder
The JAR file (in the project folder)
o A sample text file (in the project folder)
Notes
Read about the creation of Open and Save Dialog windows.