这几天写的小例子到最后也就是差不多明年的三月份,我会写一个完整的例子,类似于学生管理系统到时候请各位大佬帮忙看看有何不足。
第一个面板的代码
package 通讯录;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.RandomAccessFile;
import javax.swing.Box;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
public class inputArea extends JPanel implements ActionListener {
File f = null;
RandomAccessFile out;
JTextField name,email,phone;
JButton button;
Box boxV1,baseBox,boxV2;
public inputArea(File f) {
// TODO Auto-generated constructor stub
setBackground(Color.cyan);
this.f=f;
name = new JTextField(12);
email = new JTextField(12);
phone = new JTextField(12);
button = new JButton("录入");
button.addActionListener(this);
boxV1 = Box.createVerticalBox();
boxV1.add(new JLabel("输入姓名"));