There are 2 List classes available in Java. One in the util package and the
other under awt package. Decide which one to use and declare the variable
studentList as for eg. java.util.List (ie. If u insist on importing both
java.util.* and java.awt.*).

                -----Original Message-----
                From:   Nguyen, Thang P [mailto:[EMAIL PROTECTED]]
                Sent:   Thursday, May 17, 2001 8:06 AM
                To:     [EMAIL PROTECTED]
                Subject:        java.awt.List error

                Hi,

                Can someone pls tell me what I did wrong here? The java
compiler keeps
                complaining about the List class.  I include the error, my
PATH, and source
                code below:
                Thanks much in advance.
                TN
                ======================   Error ===============
                C:\APPLET~1\client>javac TestDBApplet.java
                TestDBApplet.java:12: Ambiguous class: java.awt.List and
java.util.List
                        private List studentList;
                                                ^
                TestDBApplet.java:22: Ambiguous class: java.awt.List and
java.util.List
                                studentList = new List();
                                                  ^
                TestDBApplet.java:23: Class <<ambiguous>>List not found in
void init().
                                studentList.setFont(new Font("monospaced",
Font.PLAIN, 12)
                                                   ^
                TestDBApplet.java:24: Class <<ambiguous>>List not found in
void init().
                                this.add(BorderLayout.CENTER, studentList);
                                        ^
                ========================= Path
                ==================================================

                C:\APPLET~1\client>path

PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\ORANT\BIN;C:\ORAWIN\BIN;u:\;;C:\WINDO
                WS\S

ystem32\WBEM;C:\WINDOWS\System32\WBEM;C:\MSSQL7\BINN;C:\Program
                Files\Microsoft
                Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft
Visual
                Studio\Common
                \MSDev98\Bin;C:\Program Files\Microsoft Visual
                Studio\Common\Tools;C:\Program Fi
                les\Microsoft Visual Studio\VC98\bin;c:\program
                files\devstudio\sharedide\bin\id
                e;c:\program files\devstudio\sharedide\bin;c:\program
                files\devstudio\vc\bin;c:\

informix\bin;c:\jdk1.2.2\bin;c:\jdk1.2.2\jre\bin;c:\tomcat3.2.1\jakarta-tomc
                at-3
                .2.1\webapps\webdev\WEB-INF\classes




                ==========  my source code below ==========



                import java.awt.*;
                import java.awt.event.*;
                import java.applet.*;

                import java.util.*;
                import java.io.*;
                import java.net.*;

                public class TestDBApplet extends Applet
                {

                        private List studentList;
                        private TextArea statusTextArea;


                        private final int COLUMN_WIDTH = 20;

                        public void init()
                        {
                                this.setLayout(new BorderLayout());

                                studentList = new List();
                                studentList.setFont(new Font("monospaced",
Font.PLAIN, 12));
                                this.add(BorderLayout.CENTER, studentList);

                        }

                }


===========================================================================
                To unsubscribe: mailto [EMAIL PROTECTED] with body:
"signoff JSP-INTEREST".
                For digest: mailto [EMAIL PROTECTED] with body: "set
JSP-INTEREST DIGEST".
                Some relevant FAQs on JSP/Servlets can be found at:

                 http://java.sun.com/products/jsp/faq.html
                 http://www.esperanto.org.nz/jsp/jspfaq.html
                 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
                 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to