[英]Netbeans not giving hints
Normally, I get little yellow hints from Netbeans. 正常情况下,我从Netbeans那里得到的黄色提示很少。 As can be seen, the class fails to compile, but there are no hints from Netbeans where normally I would expect to see little yellow hints on the line numbers:
可以看出,该类无法编译,但是Netbeans没有任何提示,通常我希望在行号上看不到黄色提示:
I have the throws option configured as so: 我将throws选项配置为:
I'm not seeing hints about declaring objects, either. 我也没有看到有关声明对象的提示。 It's like hints are disabled.
就像提示被禁用了。 How do I re-enable hints?
如何重新启用提示?
Edit: 编辑:
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() {
}
}
Stack trace showing this class failing to compile: 堆栈跟踪显示此类无法编译:
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)
This is not answer, it's additional information. 这不是答案,是其他信息。 The problem resolved itself spontaneously.
问题自发地解决了。 Maybe it's because I quit Netbeans.
也许是因为我退出了Netbeans。 Maybe it's because I rebooted.
也许是因为我重新启动了。 Maybe it's gremlins:
也许是妖精:
Just to be clear, compile-on-save is still disabled and it's the same version of Netbeans. 需要明确的是,保存时编译仍处于禁用状态,并且与Netbeans版本相同。
I had the same issue after copying an example off an internet web page. 从互联网网页复制示例后,我遇到了同样的问题。 After rebooting Netbeans I did get the hints again.
重新启动Netbeans之后,我确实再次得到了提示。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.