error with method beep?

when i wrote the following codeJOptionPane.showMessageDialog(null, "You Must Enter A Name! " );void beep();it gave me two errors in the beep code:1-illegal start of expression2-'; ' expectedalthough i have imported the class toolkit?
[277 byte] By [First_knighta] at [2007-11-27 6:29:26]
# 1
You can't just import the class, you have to use it in the code too. You can create a Toolkit object with this method:Toolkit tk = Toolkit.getDefaultToolkit();Then call the beep method on that reference:tk.beep();
hunter9000a at 2007-7-12 17:53:32 > top of Java-index,Java Essentials,New To Java...
# 2
donethank you so much
First_knighta at 2007-7-12 17:53:32 > top of Java-index,Java Essentials,New To Java...