通常,我会从 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)