2009-06-06 38 views
0

無法解決聲明我得到在Eclipse中出現以下錯誤:Eclipse的Java項目的錯誤:在揮杆

DISPOSE_ON_CLOSE cannot be resolved something.java javadir/src/ line xxxx Java Problem 

DISPOSE_ON_CLOSEjavax.swing但即使當我添加import javax.swing.*;這是行不通的。

任何想法?

回答

4

開始與一個完全合格的參考:

javax.swing.WindowConstants.DISPOSE_ON_CLOSE 

那麼當你有時間,請繼續閱讀static import

1

DISPOSE_ON_CLOSE此款直接的javax.swing *,但在WindowConstants中的接口。 ,所以你需要使用WindowConstants.DISPOSE_ON_CLOSE