谁帮忙给我写下 JAVA的代码

来源:百度知道 编辑:UC知道 时间:2024/05/18 20:36:22
请高手帮忙:
程序组合设计:根据课本上及网站上所提供源程序,将一些程序进行组合。如将网站上有关组件的实例,设计一个综合组件的程序,输入学生的姓名(文本框)、性别(单选)、专业(下拉框)、兴趣(复选框)等内容。最后通过“显示”按钮,综合所有的输入内容,在一个文本区域框中显示出来。

2、在前一个程序基础上,增加一个保存按钮,将所输入的内容,以文本文件形式保存。以同学的姓名作为文件名。

package com;
import javax.swing.*;

import java.awt.*;
import java.awt.event.*;
public class Save extends JFrame implements ActionListener,ItemListener {

/**
* @param args
*/
String s,b;
JTextField text;
JButton button;
ButtonGroup buttong;
JRadioButton radio1,radio2;
JComboBox com;
String[] str = {"English","Electronics","History","Chinese"};
JCheckBox box1,box2,box3;
JTextArea area;
public Save() {

super("Message");
setLayout(new GridLayout(6,1));
JPanel p = new JPanel();
p.setLayout(new GridLayout(1,2));
add(p);
JLabel label1 = new JLabel("name");
p.add(label1);
text = new JTextField(5);
p.add(text);
text.addActionListener(this);
JPanel p2 = new JPanel();
p2.setLayout(new GridLayout(1,3));
ad