由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - eclipse 怪问题
相关主题
输入中文导致的死 机倒霉的Swing代码总是导致Exception, fatal error
eclipse 做gui问题ThreadLocal 的一个 use case
我这个简单例子,怎么在actionListener里面拿到contentPane的instance?eclipse question,please help
为啥画不出来?java新手弱问(eclipse)
java ,wait ,notify notifyallA rookie question on Java GUI
请教GUI程序的save/load功能的实现java gc之前有没有办法得到notification?
问个进度条的问题question about repaint, update and paint
Eclipse and jar怎么在application实现delay?
相关话题的讨论汇总
话题: override话题: jf话题: eclipse话题: import话题: jframe
进入Java版参与讨论
1 (共1页)
m*****k
发帖数: 731
1
我的eclipse 对如下报错误,必须comment掉@Override才行,我都要
疯了。
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
public class FooGUI {
public static void main(String[] args) {
//initialize GUI components
final JFrame jf = new JFrame("Hello world!"); //allows jf to be
accessed from inner class body
jf.add(new JButton("Click me"));

// pack and make visible on the Event-Dispatch Thread
SwingUtilities.invokeLater(new Runnable() {
@Override  //不work, has to comment out
public void run(){
// TODO Auto-generated method stub
jf.pack(); //this would be a compile-time error if jf were
not final
jf.setLocationRelativeTo(null);
jf.setVisible(true);
}
});
}
}
T****U
发帖数: 3344
2
object class没有run method, 你怎么override?

【在 m*****k 的大作中提到】
: 我的eclipse 对如下报错误,必须comment掉@Override才行,我都要
: 疯了。
: import javax.swing.JButton;
: import javax.swing.JFrame;
: import javax.swing.SwingUtilities;
: public class FooGUI {
: public static void main(String[] args) {
: //initialize GUI components
: final JFrame jf = new JFrame("Hello world!"); //allows jf to be
: accessed from inner class body

z*******3
发帖数: 13709
3
我可以
提示什么错误?
z*******3
发帖数: 13709
4
匿名类

【在 T****U 的大作中提到】
: object class没有run method, 你怎么override?
N***m
发帖数: 4460
5
are you using java 1.5?

【在 m*****k 的大作中提到】
: 我的eclipse 对如下报错误,必须comment掉@Override才行,我都要
: 疯了。
: import javax.swing.JButton;
: import javax.swing.JFrame;
: import javax.swing.SwingUtilities;
: public class FooGUI {
: public static void main(String[] args) {
: //initialize GUI components
: final JFrame jf = new JFrame("Hello world!"); //allows jf to be
: accessed from inner class body

m*****k
发帖数: 731
6
1.6035

【在 N***m 的大作中提到】
: are you using java 1.5?
m*****k
发帖数: 731
7
Multiple markers at this line
- implements java.lang.Runnable.run
- The method run() of type new Runnable(){} must override a superclass
method
I believe my eclipse messed up,
I restarted eclipse, same error.
I will restart my win and see,

【在 z*******3 的大作中提到】
: 我可以
: 提示什么错误?

w**z
发帖数: 8232
8
override interface is the new feature added for jdk 6, double check your
Eclipse setting, by default it is using jdk 5 to compile.

【在 m*****k 的大作中提到】
: Multiple markers at this line
: - implements java.lang.Runnable.run
: - The method run() of type new Runnable(){} must override a superclass
: method
: I believe my eclipse messed up,
: I restarted eclipse, same error.
: I will restart my win and see,

z*******3
发帖数: 13709
9
我觉得楼上说得有道理
去preference->java->compiler里面看看
我的同事也有过类似的问题
当时就查java版本,默认是1.4
放狗搜出来的这句话我很喜欢
“This byzantine menu / dialog interface is typical of Eclipse's poor UI
design.”

【在 m*****k 的大作中提到】
: Multiple markers at this line
: - implements java.lang.Runnable.run
: - The method run() of type new Runnable(){} must override a superclass
: method
: I believe my eclipse messed up,
: I restarted eclipse, same error.
: I will restart my win and see,

m*****k
发帖数: 731
10
it shows 1.6, wtf.
1 (共1页)
进入Java版参与讨论
相关主题
怎么在application实现delay?java ,wait ,notify notifyall
怎么控制paint?请教GUI程序的save/load功能的实现
eclipse hot key问个进度条的问题
@Override annotation.Eclipse and jar
输入中文导致的死 机倒霉的Swing代码总是导致Exception, fatal error
eclipse 做gui问题ThreadLocal 的一个 use case
我这个简单例子,怎么在actionListener里面拿到contentPane的instance?eclipse question,please help
为啥画不出来?java新手弱问(eclipse)
相关话题的讨论汇总
话题: override话题: jf话题: eclipse话题: import话题: jframe