注册页面点击按钮要如何实现页面切换啊
界面代码都在这了,麻烦教一下
import java.awt.Color;
import java.awt.Font;
import java.awt.Toolkit;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
public class dlym {
public dlym(){
aa();
}
private void aa() {
// TODO 自动生成的方法存根
JFrame frame=new JFrame("Wzzzz");
frame.setSize(500,500);
frame.setResizable(false);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel down=new JPanel();
down.setLayout(null);
//down.setBounds(0,50,400,260);
down.setBackground(Color.white);
JLabel jlable3=new JLabel("账号:");
jlable3.setBounds(100,170,120,30);
jlable3.setFont(new Font("",1,30));
jlable3.setForeground(Color.black);
down.add(jlable3);
JLabel lable1=new JLabel();
lable1.setBounds(200,25,100,100);
lable1.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().getImage("images/1.jpg")));
down.add(lable1);
JTextField account =new JTextField();
account.setBounds(200,170,200,30);
down.add(account);
JLabel jlable4=new JLabel("密码:");
jlable4.setBounds(100,250,120,30);
jlable4.setFont(new Font("",1,30));
jlable4.setForeground(Color.black);
down.add(jlable4);
JTextField jpassw =new JTextField();
jpassw.setBounds(200,250,200,30);
down.add(jpassw);
JButton bb=new JButton("登录");
bb.setBounds(100,320,145,50);
bb.setBackground(Color.blue);
bb.setForeground(Color.white);
down.add(bb);
JButton aa=new JButton("注册");
aa.setBounds(255,320,150,50);
aa.setBackground(Color.blue);
aa.setForeground(Color.white);
down.add(aa);
frame.add(down);
frame.setVisible(true);
}
}