无法解析类型 javax.swing.JComponent.从必需的 .class 文件间接引用了它
packageGUI;importjavax.swing.*;importjava.util.concurrent.*;publicclassHelloLabel{pub...
package GUI;
import javax.swing.*;
import java.util.concurrent.*;
public class HelloLabel {
public static void main(String[] args) throws Exception{
JFrame frame=new JFrame("liaomeng");
JLabel label=new JLabel("A Label");
frame.add(label);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(300,300);
frame.setVisible(true);
TimeUnit.SECONDS.sleep(1);
label.setText("Hey,I am very cool!");
}
}
在eclipse上编译运行失败!!!!!!!!!!!! 展开
import javax.swing.*;
import java.util.concurrent.*;
public class HelloLabel {
public static void main(String[] args) throws Exception{
JFrame frame=new JFrame("liaomeng");
JLabel label=new JLabel("A Label");
frame.add(label);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(300,300);
frame.setVisible(true);
TimeUnit.SECONDS.sleep(1);
label.setText("Hey,I am very cool!");
}
}
在eclipse上编译运行失败!!!!!!!!!!!! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询