I've made an alarm clock class and part of the code is to pick music that plays. I created a button that when clicked opens a dialog to pick the buttons for music. But, I'm having trouble with the super in this class, a problem that my other windows haven't given me. Bear with me, I'm very bad at all of this. Here is the music dialog class (tell me if you need my other classes to answer)
import java.awt.*;
import java.io.*;
public class SetMusicDialog extends Dialog
{
public static String sng;
public SetMusicDialog()
{
super ( "Set Music");
Panel mpanel;
Font l = new Font("Helvetica", Font.ITALIC, 12);
setFont(l);//sets font
setBackground(Color.cyan);
Panel f = new Panel();
f.add("West", new Button("Death Grips"));
f.add("East", new Button("Siren"));
add("South",f);
pack(); // make it just fit
resize(preferredSize());
move(200,200);
}
public boolean handleEvent1 (Event evt)
{
switch (evt.id)
{
case Event.ACTION_EVENT:
if("Death Grips".equals(evt.arg))
{
sng= "breakmirrors.wav";
}
else if("Siren".equals(evt.arg))
{
sng= "bip.wav";
}
}
}
}
This is the error I keep getting:
Error: no suitable constructor found for Dialog(java.lang.String)
constructor java.awt.Dialog.Dialog(java.awt.Frame) is not applicable
(argument mismatch; java.lang.String cannot be converted to java.awt.Frame)
constructor java.awt.Dialog.Dialog(java.awt.Dialog) is not applicable
(argument mismatch; java.lang.String cannot be converted to java.awt.Dialog)
constructor java.awt.Dialog.Dialog(java.awt.Window) is not applicable
(argument mismatch; java.lang.String cannot be converted to java.awt.Window)