讲解:JavaTextEditorHomework Java、Java

Introduction效果使用面向对象方式写程序创建图形用户界面使用文件编程分数在每个java文件开头,需要有学生姓名课程日期文件名类的描述注释每个方法和构造函数需要一行注释专栏描述项目文件以Homework08.zip提交。1 创建项目,名为TextEditor2 实现TextEditor,该类为JFrame的子类3 这个程序的目标是创建一个文本编辑器。请参阅以下界面:4有4个按钮a.New,该按钮清空文本域,将“正在使用的文件”设置为none(null)如果文件正在使用,该操作忽略并清空文本区域,将“正在使用的文件”设置为none(null)b. Open,该按钮弹出打开一个窗口对话框,其中用户选择一个文本文件,文本文件将加载到文本框中,将“正在使用的文件”设置为用户选择的文件。如果文件已经在使用中,按钮忽略它并打开选中的文件c. Save as,该按钮打开保存窗口对话框,其中用户选择一个文件名,文本域中的内容被存储到新文件中,设置正在使用的文件为刚刚选择的文件d. Save,如果正在使用的文件尾空,该按钮使用操作同Save as一样。否则,该按钮写入文件到正在使用的文件。5 四个按钮布局为North。6 Center区域是文本域7 South区域显示正在使用的文件8 实现TextEditorTest类来测试你的程序9 创建jar文件提交zip文件必须包含Eclipse工程文件夹jar文件,在工程文件夹中文本文件(在工程文件夹中)P7.16:一个酒店销售人员以文本文件输入销售额。每行包含以下内容,用分号分隔:客户名称,销售的服务(如晚餐,会议,住宿等),销售金额以及 该事件的日期。编写一个读取此类文件的程序,并显示每个服务类别的总金额。如果该文件不存在或格式不正确,则显示错误。P7.17:编写一个读取文本文件的程序,如练习P7.16所述,并为每个服务类别编写一个单独的文件,其中包含该类别的条目。将输出文件Dinner.txt,Conference.txt等命名为输出文件。RequirementHomework 08Outcomes 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 methodnames (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 followinginformation: Student’s name Course/section, Date Filename Description of the program/classo Indentation guidelines: The code inside of a class must be indented with respect to the classdefinition. The code inside of a method must be indented with respect to themethod definition. The code inside of if / else / else if / while / for / do-while structuresmust be indented with respect to its corresponding structure. Curly braces can be positioned at the end of the correspondingstructure definition, or in the following lines aligned with thecorrespoJava代写TextEditorHomework 调试Java作业、Java实验代做nding structure.o Comments: At least, one-line comment should be added per method orconstructor. Comments must describe the functionality or objective of themethod. Please add more comments about your code, if you think that willThis assignment consists of the development of one project. The project should be stored inits own folder. Submit the project folder in a zip file, named Homework08.zip , to thecorresponding 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, andsets the “file in use” to none.b. Open. This button opens an “open dialog window”, where the user selects atext file. The text file is uploaded to the text area. Sets the “file in use” to thefile which was selected by the user.i. If a file is already in use, this button just ignore it an open theselected text file.c. Save as. This button open an “save dialog window”, where the user selects alocation and a name for a new text file. The content of the text area is storedin the new file. Sets the “file in use” to the file which was selected by theuser.d. Save. If the “file in use” is set to none, this button do the same functionalitylike the Save as button. Otherwise, this button writes the content of the textarea 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 labeldisplay 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 folderThe JAR file (in the project folder)o A sample text file (in the project folder)NotesRead about the creation of Open and Save Dialog windows.& 转自:http://ass.3daixie.com/2018052610004961.html

你可能感兴趣的:(讲解:JavaTextEditorHomework Java、Java)