[英]Netbeans not giving hints
正常情況下,我從Netbeans那里得到的黃色提示很少。 可以看出,該類無法編譯,但是Netbeans沒有任何提示,通常我希望在行號上看不到黃色提示:
我將throws選項配置為:
我也沒有看到有關聲明對象的提示。 就像提示被禁用了。 如何重新啟用提示?
編輯:
code as follows:
package net.bounceme.dur.nntp.swing;
import java.util.logging.Logger;
import javax.swing.DefaultListModel;
import javax.swing.JList;
import javax.swing.JScrollPane;
import net.bounceme.dur.nntp.gnu.Page;
import net.bounceme.dur.nntp.gnu.Usenet;
public class MyPanel extends JScrollPane {
private static final Logger LOG = Logger.getLogger(MyPanel.class.getName());
private JList jList;
private DefaultListModel defaultListModel;
private Usenet u = Usenet.INSTANCE;
private Page page;
public MyPanel() {
page = u.getPage(new Page().getPmd()); //uncaught exception
jList = new JList(defaultListModel); // null, need to initialize
initComponents();
}
private void initComponents() {
}
}
堆棧跟蹤顯示此類無法編譯:
init:
Deleting: /home/thufir/NetBeansProjects/gnumail-providers/build/built-jar.properties
deps-jar:
Updating property file: /home/thufir/NetBeansProjects/gnumail-providers/build/built-jar.properties
Compiling 1 source file to /home/thufir/NetBeansProjects/gnumail-providers/build/classes
/home/thufir/NetBeansProjects/gnumail-providers/src/net/bounceme/dur/nntp/swing/MyPanel.java:19: error: unreported exception Exception; must be caught or declared to be thrown
page = u.getPage(new Page().getPmd()); //uncaught exception
Note: /home/thufir/NetBeansProjects/gnumail-providers/src/net/bounceme/dur/nntp/swing/MyPanel.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
/home/thufir/NetBeansProjects/gnumail-providers/nbproject/build-impl.xml:624: The following error occurred while executing this line:
/home/thufir/NetBeansProjects/gnumail-providers/nbproject/build-impl.xml:243: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 0 seconds)
這不是答案,是其他信息。 問題自發地解決了。 也許是因為我退出了Netbeans。 也許是因為我重新啟動了。 也許是妖精:
需要明確的是,保存時編譯仍處於禁用狀態,並且與Netbeans版本相同。
從互聯網網頁復制示例后,我遇到了同樣的問題。 重新啟動Netbeans之后,我確實再次得到了提示。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.