我无法在程序中找到错误。我对此非常感兴趣,我们将非常感谢任何帮助。我有错误,我不知道如何解决。我的完整代码如下:
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class SampleApp3 extends JFrame{
Container pane;
JLabel label1;
JLabel label2;
Jlabel label3;
Jlabel label4;
public SampleApp3(){
pane=getContentPane();
setSize(650, 540);
setTitle("FormExample");
pane.setLayout(null);
label1= new JLabel("STI College Las Pinas",SwingConstants.CENTER);
label1.setBackground(Color.yellow);
label1.setToolTipText("Pogi Ako");
label1.setForeground(Color.blue);
pane.setBackground(Color.yellow);
label1.setBounds(100,210,325,50);
pane.add(label1,"Center");
label2= new JLabel("Charles Jason Decena",SwingConstants.CENTER);
label2.setBackground(Color.yellow);
label2.setToolTipText("Si Charles ay Pogi");
label2.setForeground(Color.blue);
pane.setBackground(Color.yellow);
label2.setBounds(110,215,320,48);
pane.add(label2,"Center");
label3= new JLabel("BSIT-124",SwingConstants.CENTER);
label3.setBackground(Color.yellow);
label3.setToolTipText("Ehem si Decena ay pogi");
label3.setForeground(Color.blue);
pane.setBackground(Color.yellow);
label3.setBounds(120,220,315,46);
pane.add(label3,"Center");
label4= new JLabel("Computer Programming 2",SwingConstants.CENTER);
label4.setBackground(Color.yellow);
label4.setToolTipText("Well Pogi talaga ako");
label4.setForeground(Color.blue);
pane.setBackground(Color.yellow);
label4.setBounds(130,225,315,44);
pane.add(label4,"Center");
}
public static void main(String args[]) {
SampleApp3= new SampleApp3(); //and this one
app.setVisible(true);
}
}
错误消息显示Jlabel
3和4"无法找到符号"并且还包含文本sampleapp3。任何人都可以帮我解决导致错误的原因吗?
答案 0 :(得分:5)
Java区分大小写
Jlabel label3;
Jlabel label4;
两者都无效。该类为JLabel
(注意L为大写)