简体   繁体   中英

Netbeans - a method call becomes italic - and causing error

What does it mean in netbeans when a statement like the code below becomes all italic?

    MessageBox.show("test", "test");

I get the error below as well on runtime. But not when coding, just the ".show()" method that's not appearing in autocomplete. But the class is already in its appropriate folder and is already imported. What could be the problem here as well?

 Uncompilable source code - Erroneous sym type: library.MessageBox.show

Complete code:

public class MessageBox {

    public static void show(String titleString, String messageString)
    {
        JOptionPane.showMessageDialog(null, messageString, titleString, JOptionPane.INFORMATION_MESSAGE);
    }
}

The above code you provided runs fine on eclipse.

As you said you are using Netbeans and may be affected by a bug. Try this:

Open the project properties, select the Build-Compiling, uncheck "Compile on save" and rerun the application.

This will make sure all your source code becomes recompiled before running it.

Ref: https://netbeans.org/community/news/show/1647.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM