要求:当输入123,123时,默认跳转下一页(建立一个查询窗口),我不会新建窗口了
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
public class jizhu extends JFrame implements ActionListener
{
Icon ic;
JPanel j1,j2;
JLabel l1,l2,Ibj;
JTextField t1,t2;
JButton b1,b2;
CardLayout c;
jizhu()
{
super ("会员登录");
ic=new ImageIcon("004.jpg");
Ibj=new JLabel(ic);
b1=new JButton("登录");
b2=new JButton("返回");
j1=new JPanel();
j2=new JPanel();
l1=new JLabel("帐号");
l2=new JLabel("密码");
t1=new JTextField();
t2=new JTextField();
c=new CardLayout();
Dimension di=getToolkit().getScreenSize();
setLocation((di.width-200)/2,(di.height-200)/2); setLayout(null);
b1.setFont(new Font("宋体",5,15));
b2.setFont(new Font("宋体",5,15));
l1.setFont(new Font("宋体",5,15));
l2.setFont(new Font("宋体",5,15));
b1.setForeground(Color.red);
b2.setForeground(Color.red);
l1.setForeground(Color.blue);
l2.setForeground(Color.blue);
b1.addActionListener(this);
b2.addActionListener(this);
add(b1);add(l2);add(t1);add(t2);
add(b2);add(l1);add(Ibj);
l1.setBounds(20,20,50,20);
l2.setBounds(20,60,50,20);
b1.setBounds(20,100,80,20);
t1.setBounds(100,20,80,20);
t2.setBounds(100,60,80,20);
b2.setBounds(100,100,80,20);
setSize(480,360);
Ibj.setBounds(0,0,480,360);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==b1)
remove(b2);
}
public static void main(String arg[])
{
new jizhu().setVisible(true);
}
}

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
public class jizhu extends JFrame implements ActionListener
{
Icon ic;
JPanel j1,j2;
JLabel l1,l2,Ibj;
JTextField t1,t2;
JButton b1,b2;
CardLayout c;
jizhu()
{
super ("会员登录");
ic=new ImageIcon("004.jpg");
Ibj=new JLabel(ic);
b1=new JButton("登录");
b2=new JButton("返回");
j1=new JPanel();
j2=new JPanel();
l1=new JLabel("帐号");
l2=new JLabel("密码");
t1=new JTextField();
t2=new JTextField();
c=new CardLayout();
Dimension di=getToolkit().getScreenSize();
setLocation((di.width-200)/2,(di.height-200)/2); setLayout(null);
b1.setFont(new Font("宋体",5,15));
b2.setFont(new Font("宋体",5,15));
l1.setFont(new Font("宋体",5,15));
l2.setFont(new Font("宋体",5,15));
b1.setForeground(Color.red);
b2.setForeground(Color.red);
l1.setForeground(Color.blue);
l2.setForeground(Color.blue);
b1.addActionListener(this);
b2.addActionListener(this);
add(b1);add(l2);add(t1);add(t2);
add(b2);add(l1);add(Ibj);
l1.setBounds(20,20,50,20);
l2.setBounds(20,60,50,20);
b1.setBounds(20,100,80,20);
t1.setBounds(100,20,80,20);
t2.setBounds(100,60,80,20);
b2.setBounds(100,100,80,20);
setSize(480,360);
Ibj.setBounds(0,0,480,360);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==b1)
remove(b2);
}
public static void main(String arg[])
{
new jizhu().setVisible(true);
}
}