我正在学习 Java,但我不知道如何做到这一点。
我在 Netbeans 的表单上拖动了一个按钮,双击它并创建了这个事件:
@Action
public void HelloClickMethod()
{
JOptionPane.showMessageDialog(this, "The message!", "This is supposed to be the MessageBox title.");
}
这是 IDE 提出的例外情况。
找不到标志。符号:showMessageDialog()
编辑 1> 现在我将其更改为:
@Action
public void HelloClickMethod()
{
JOptionPane.showMessageDialog(this, "The message!", "This is supposed to be the MessageBox title.",JOptionPane.ERROR_MESSAGE);
}
但是 IDE 说我在“this”这个词中有一个错误。“找不到标志”。我不明白。为什么它如此困难,为什么错误如此深奥。:P