set1List = new List();
set1List.setBackground(Color.white);
After coding the rest of the Applet example, the following two
lines are required at the top of the Applet code:
import java.awt.*;
import java.util.*;
When I compiler the Applet, the following error is produced:
SetApplet.java:31: Ambiguous class: java.awt.List and java.util.List
set1List = new List();
^
It seems the compiler does not know whether to use the
java.awt.List or java.util.List definition.
How can I tell the code that the List box should come from
java.awt.List???
UncleT
[...]
> It seems the compiler does not know whether to use the
> java.awt.List or java.util.List definition.
> How can I tell the code that the List box should come from
> java.awt.List???
Add
import java.awt.List
after the other imports.
Christian
java.awt.List myList = new java.awt.List();
Arthur
Christian Kaufhold wrote in message
<7oen4u$j6c$1...@f40-3.zfn.uni-bremen.de>...
> I wrote Applet code (based on examples in a java beginner's book) that
> defines a LIST box as follows:
>
> set1List = new List();
> set1List.setBackground(Color.white);
>
> After coding the rest of the Applet example, the following two
> lines are required at the top of the Applet code:
>
> import java.awt.*;
> import java.util.*;
>
> When I compiler the Applet, the following error is produced:
>
> SetApplet.java:31: Ambiguous class: java.awt.List and java.util.List
> set1List = new List();
> ^
> It seems the compiler does not know whether to use the
> java.awt.List or java.util.List definition.
>
> How can I tell the code that the List box should come from
> java.awt.List???
Just name it with fully qualified name explicitly.
set1List=new java.awt.List();
--
Tony
@iSilk.com