Java语言进阶实验指导书 下载本文

实验四 MVC in GUI (GUI中的MVC模式)

一、实验目的:

1. 掌握MVC设计模式的概念。

2. 掌握应用MVC模式开发图形用户界面应用程序的方法。

二、实验内容:

(Creating a student table ) Create a table for student records. Each record consists

of name, birthday, class status, in-state, and a photo, as shown in Figure 1. The name is of the String type; birthday is of the Date type; class status is one of the following five values: Freshman, Sophomore, Junior, Senior, or Graduate; in-state is a boolean value indicating whether the student is a resident of the state; and photo is an image icon. Use the default editors for name, birthday, and in-state. Supply a combo box as custom editor for class status..

Figure 1.

三、实验要求:

1、认真执行每一个步骤的,并作好记录。

2、实验报告中给出配置的详细步骤和重要的截图。

四、实验学时:2学时

五、实验步骤:

(请给出详细代码,并加入代码注释,注释是成绩高低和判定是否抄袭的一个重要依据。)

实验五 JDBC Programming (JDBC数据库编程)

一、实验目的:

掌握应用JDBC技术访问数据库的方法。

二、实验内容:

(Accessing and updating a Staff table) Write a Java application that views, inserts, and updates staff information stored in a database, as shown in Figure 1.

The View button displays a record with a specified ID. The Staff table is created as follows:

create table Staff ( id char(9) not null, lastName varchar(15), firstName varchar(15), mi char(1),

address varchar(20), city varchar(20), state char(2),

telephone char(10), email varchar(40), primary key (id) );

Figure 1.

三、实验要求:

1、认真执行每一个步骤的,并作好记录。

2、实验报告中给出配置的详细步骤和重要的截图。

四、实验学时:2学时

五、实验步骤:

(请给出详细代码,并加入代码注释,注释是成绩高低和判定是否抄袭的一个重要依据。)