I’m trying to declare a java.awt.FileDialog in my code:
FileDialog save = new FileDialog(null, "Save file", FileDialog.SAVE);
But I get the following error in my console when I try to run my code:
The constructor FileDialog(Frame, String, int) is ambiguous
Anyone know what I am doing wrong?
There are 2 constructors for FileDialog with 3 arguments. Because you passed null as the first argument, the compiler cannot distinguish which constructor you want.
and
You could use:
to fix.