提示错误: 27行这段代码 "找不到符号"~~ 是什么错误?
p.setLayout(GridLayout);代码:import javax.swing.*;
import java.awt.*;
public class FrameTest extends JFrame{
JButton denglu;
JTextField txt;
JPasswordField pwd;
public FrameTest(){
/********北*********/
JLabel tou=new JLabel(new ImageIcon("01.gif"));
JPanel p=new JPanel();
/********中************/
JLabel haoma=new JLabel("QQ帐号");
JLabel mima=new JLabel("QQ密码");
txt=new JTextField();
pwd=new JPasswordField();
JCheckBox yinshen=new JCheckBox();
JCheckBox zidong=new JCheckBox();
JLabel shenqing=new JLabel("申请帐号");
JLabel wang=new JLabel("忘记密码");
shenqing.setCursor(new Cursor(Cursor.HAND_CURSOR));
wang.setCursor(new Cursor(Cursor.HAND_CURSOR));
wang.setForeground(Color.BLUE);
shenqing.setForeground(Color.BLUE);
p.setLayout(GridLayout);
//p.setLayout(GridLayout(3,3));
p.add(haoma);
p.add(txt);
p.add(shenqing);
p.add(mima);
p.add(pwd);
p.add(wang);
p.add(yinshen);
p.add(wang);
p.add(wang);
this.setSize(300,400);
this.setVisible(true);
}
public static void main(String args[]){
FrameTest test=new FrameTest();
}
}
p.setLayout(GridLayout);代码:import javax.swing.*;
import java.awt.*;
public class FrameTest extends JFrame{
JButton denglu;
JTextField txt;
JPasswordField pwd;
public FrameTest(){
/********北*********/
JLabel tou=new JLabel(new ImageIcon("01.gif"));
JPanel p=new JPanel();
/********中************/
JLabel haoma=new JLabel("QQ帐号");
JLabel mima=new JLabel("QQ密码");
txt=new JTextField();
pwd=new JPasswordField();
JCheckBox yinshen=new JCheckBox();
JCheckBox zidong=new JCheckBox();
JLabel shenqing=new JLabel("申请帐号");
JLabel wang=new JLabel("忘记密码");
shenqing.setCursor(new Cursor(Cursor.HAND_CURSOR));
wang.setCursor(new Cursor(Cursor.HAND_CURSOR));
wang.setForeground(Color.BLUE);
shenqing.setForeground(Color.BLUE);
p.setLayout(GridLayout);
//p.setLayout(GridLayout(3,3));
p.add(haoma);
p.add(txt);
p.add(shenqing);
p.add(mima);
p.add(pwd);
p.add(wang);
p.add(yinshen);
p.add(wang);
p.add(wang);
this.setSize(300,400);
this.setVisible(true);
}
public static void main(String args[]){
FrameTest test=new FrameTest();
}
}
import javax.swing.*;
import java.awt.*;
public class FrameTest extends JFrame{
JButton denglu;
JTextField txt;
JPasswordField pwd;
public FrameTest(){
/********北*********/
JLabel tou=new JLabel(new ImageIcon( "01.gif "));
JPanel p=new JPanel();
/********中************/
JLabel haoma=new JLabel( "QQ帐号 ");
JLabel mima=new JLabel( "QQ密码 ");
txt=new JTextField();
pwd=new JPasswordField();
JCheckBox yinshen=new JCheckBox();
JCheckBox zidong=new JCheckBox();
JLabel shenqing=new JLabel( "申请帐号 ");
JLabel wang=new JLabel( "忘记密码 ");
shenqing.setCursor(new Cursor(Cursor.HAND_CURSOR));
wang.setCursor(new Cursor(Cursor.HAND_CURSOR));
wang.setForeground(Color.BLUE);
shenqing.setForeground(Color.BLUE); p.setLayout(new GridLayout());
//p.setLayout(GridLayout(3,3));
p.add(haoma);
p.add(txt);
p.add(shenqing);
p.add(mima);
p.add(pwd);
p.add(wang);
p.add(yinshen);
p.add(wang);
p.add(wang); this.setSize(300,400);
this.setVisible(true);
} public static void main(String args[]){
FrameTest test=new FrameTest();
}
}