初学者关于JFrame的问题

westwin 2003-07-24 05:33:24
照搬sun的tutorial中的代码如下:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;


public class FrameDemo {
public static void main(String s[]) {

JFrame.setDefaultLookAndFeelDecorated(true);

//Create and set up the window.
JFrame frame = new JFrame("FrameDemo");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

JLabel emptyLabel = new JLabel("");
emptyLabel.setPreferredSize(new Dimension(175, 100));
frame.getContentPane().add(emptyLabel, BorderLayout.CENTER);

//Display the window.
frame.pack();
frame.setVisible(true);
}
}
其中,编译的时候,说JFrame.setDefaultLookAndFeelDecorated(true);这行不认,请问哪里错了
...全文
46 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
popularboy1wbr 2003-07-25
  • 打赏
  • 举报
回复
up
songlean 2003-07-25
  • 打赏
  • 举报
回复
你得jdk版本是多少?要1.4以上才行
westwin 2003-07-25
  • 打赏
  • 举报
回复
ft,还是不行,求救
westwin 2003-07-24
  • 打赏
  • 举报
回复
谢谢,解决了,import.java.awt.Frame.*;

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧