Cannot Resolve Copy

C:\jdk11\java\bin>javac IndexOfMethodThree.java
IndexOfMethodThree.java:9: cannot resolve symbol
symbol : constructor BufferedReader (java.io.InputStream)
location: class java.io.BufferedReader
BufferedReader br = (new BufferedReader(System.in));
^
1 error
I get the above message with the following code.
Anyone know what i could be doing wrong?
import java.io.*;
class IndexOfMethodThree {
public static void main (String[] args) {
System.out.print("Hello: ");
BufferedReader br = (new BufferedReader(System.in));
String s = br.readLine();
String str1 = "fartfresar";
str1.indexOf(s);
System.out.println(str1.indexOf(s));
} // end of readMyFile()
} // end of class
Thanks

Something like this?
I am trying to get the user to enter a text file to be serached for by a sequence?
import java.io.*;
class IndexOfMethodThree {
public static void main (String[] args) {
System.out.print("Please enter text file: ");
BufferedReader br = (new BufferedReader(new FileInputStream("System.in"));
String s = br.readLine();
String str1 = "fartfresar";
str1.indexOf(s);
System.out.println(str1.indexOf(s));
} // end of readMyFile()
} // end of class

Similar Messages

  • Solaris Deployment Failure for cannot resolve symbol on PersistentContainer

    Hello, I'm having trouble diagnosing the following deployment failure.
    What are some common causes of this? My server was created using an
    Express Integration domain with some custom JMS destinations added
    afterwards via the console. I am deploying an application built with
    Workshop (straight from workshop). I copied over an application from
    Windows to Solaris, deleted the .workshop directory and .beabuild.txt
    and rebuilt the application to deploy.
    I get this error a few times.
    ####<Aug 21, 2003 10:48:19 AM EDT> <Info> <EJB> <rhino> <cgServer>
    <ExecuteThread: '1' for queue: 'weblogic.kernel.System'> <<WLS Kernel>>
    <> <BEA-012033> <Compiling generated EJB classes produced the following
    Java compiler output:
    /export/data/ident/bea/user_projects/domains/ident1Server.conf/./cgServer/.wlnotdelete/EJBCompilerCache/-7dxi2hv35mro/com/bea/wlwgen/PersistentContainer_3fq3ar_Impl.java:143:
    cannot resolve symbol
    symbol : class BMPContainerBean$DuplicateKeyRemoteException
    location: package bean
    perchance you meant 'BMPContainerBean.DuplicateKeyRemoteException'
    throws
    com.bea.wlw.runtime.core.bean.BMPContainerBean$DuplicateKeyRemoteException
    ^
    1 error
    This then causes other errors repeating that the deployment failed (let
    me know if you need more to diagnose this):
    Exception:weblogic.management.ApplicationException: prepare failed for
    .workshop/myApp/EJB/myProc_1trtqtoxcz4uv
    Module: .workshop/myApp/EJB/myProc_1trtqtoxcz4uv Error:
    Exception preparing module:
    EJBModule(.workshop/myApp/EJB/myProc_1trtqtoxcz4uv,status=NEW)
    Unable to deploy EJB: .workshop/myApp/EJB/myProc_1trtqtoxcz4uv from
    .workshop/myApp/EJB/myProc_1trtqtoxcz4uv:
    Compiler failed executable.exec

    But by default WLS8.1 comes with jdk141_02 ...correct ?
    AND what i understand is that...the bug you posted is related to a bug in jdk1.4.2
    ....correct ??
    correct me if i wrong.
    -sangita
    Steven Ostrowski <[email protected]> wrote:
    It looks like this is a bug in the BEA-generated code that is then
    compiled by WLS. The generated code was using the Class1$Class2 notation
    to reference the class, but since $ is a valid character in the class
    name, this does not behave as intended. This used to be a bug in
    pre-1.4.2 but is now fixed in 1.4.2 (look at bug 4635044, and this is
    also mentioned in the 1.4.2 release notes and the Java Developer forums).
    The generated code should be:
    com.bea.wlw.runtime.core.bean.BMPContainerBean.DuplicateKeyRemoteException
    not
    com.bea.wlw.runtime.core.bean.BMPContainerBean$DuplicateKeyRemoteException
    Thanks again for the good response. I'll send this in to BEA support.
    Steven Ostrowski wrote:
    One other thing to add, this was fixed by changing the JAVA_HOME
    variable inside of the startWeblogic.sh script. Setting it in workshop
    did not change anything.
    Steven Ostrowski wrote:
    Wow, you hit it right on target! I was using 1.4.2 then tried it on
    1.4.1_03 and it deployed fine.
    Is this a bug in BEA or in the JDK? In either case, where should I
    report this bug?
    Thanks again
    Rob Woollen wrote:
    What version of the JDK are you using? I believe they changed the
    inner class naming conventions in 1.4.2, and it's breaking lots of
    people.
    -- Rob
    Steven Ostrowski wrote:
    Hello, I'm having trouble diagnosing the following deployment
    failure. What are some common causes of this? My server was created
    using an Express Integration domain with some custom JMS
    destinations added afterwards via the console. I am deploying an
    application built with Workshop (straight from workshop). I copied
    over an application from Windows to Solaris, deleted the .workshop
    directory and .beabuild.txt and rebuilt the application to deploy.
    I get this error a few times.
    ####<Aug 21, 2003 10:48:19 AM EDT> <Info> <EJB> <rhino> <cgServer>
    <ExecuteThread: '1' for queue: 'weblogic.kernel.System'> <<WLS
    Kernel>> <> <BEA-012033> <Compiling generated EJB classes produced
    the following Java compiler output:
    /export/data/ident/bea/user_projects/domains/ident1Server.conf/./cgServer/.wlnotdelete/EJBCompilerCache/-7dxi2hv35mro/com/bea/wlwgen/PersistentContainer_3fq3ar_Impl.java:143:
    cannot resolve symbol
    symbol : class BMPContainerBean$DuplicateKeyRemoteException
    location: package bean
    perchance you meant 'BMPContainerBean.DuplicateKeyRemoteException'
    throws
    com.bea.wlw.runtime.core.bean.BMPContainerBean$DuplicateKeyRemoteException
    ^
    1 error
    This then causes other errors repeating that the deployment failed
    (let me know if you need more to diagnose this):
    Exception:weblogic.management.ApplicationException: prepare failed
    for .workshop/myApp/EJB/myProc_1trtqtoxcz4uv
    Module: .workshop/myApp/EJB/myProc_1trtqtoxcz4uv Error:
    Exception preparing module:
    EJBModule(.workshop/myApp/EJB/myProc_1trtqtoxcz4uv,status=NEW)
    Unable to deploy EJB: .workshop/myApp/EJB/myProc_1trtqtoxcz4uv from
    .workshop/myApp/EJB/myProc_1trtqtoxcz4uv:
    Compiler failed executable.exec

  • Cannot resolve symbol error when compiling a class that calls another class

    I've read all the other messages that include "cannot resolve symbol", but no luck. I've got a small app - 3 classes all in the same package. BlackjackDAO and Player compile OK, but BlackjackServlet throws the "cannot resolve symbol" (please see pertinent code below)...
    I've tried lots: ant and javac compiling, upgrading my version of tomcat, upgrading my version of jdk/jre, making sure my servlet.jar is being seen by the compiler (at least as far as I can see from the -verbose feedback)...any help would be GREAT! Thanks in advance...
    classes: BlackjackServlet, BlackjackDAO, Player
    package: myblackjackpackage
    tomcat version: 4.1.1.8
    jdk version: j2sdk 1.4.0
    ant version: 1.4.1
    I get the same error message from Ant and Javac...
    C:\Tomcat4118\src\webapps\helloblackjack\src\myblackjackpackage>javac *.java -verbose
    C:\Tomcat4118\src\webapps\helloblackjack>ant all -verbose
    compile error:
    BlackjackServlet.java:55: cannot resolve symbol
    symbol: method addPlayer (javax.servlet.http.HttpServletRequest,javax.servlet.http.Http
    ServletResponse)
    location: class myblackjackpackage.BlackjackServlet
              addPlayer(request, response);
    ^
    My code is:
    package myblackjackpackage;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.lang.*;
    /** controller servlet in a web based blackjack game application @author Ethan Harlow */
    public class BlackjackServlet extends HttpServlet {
         private BlackjackDAO theBlackjackDAO;
         public void init() throws ServletException {
    String driver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
    String dbUrl = "jdbc:microsoft:sqlserver://localhost:1433";
    String userid = "testlogin";
    String passwrd = "testpass";
         try {
         theBlackjackDAO = new BlackjackDAO(driver, dbUrl, userid, passwrd);
         catch (IOException exc) {
              System.err.println(exc.toString());
         catch (ClassNotFoundException cnf) {
              System.err.println(cnf.toString());
         catch (SQLException seq) {
              System.err.println(seq.toString());
    public void doPost(HttpServletRequest request, HttpServletResponse response)
              throws ServletException, IOException {
    doGet(request, response);
    public void doGet(HttpServletRequest request, HttpServletResponse response)
              throws ServletException, IOException {
         String command = request.getParameter("command");
         if (command == null || (command.equals("stats"))) {
         else if (command.equals("add")) {
              try {
    //the following line is caught by compiler
              addPlayer(request, response);
              response.setContentType("text/html");
              PrintWriter out = response.getWriter();
              out.println("<html>");
              out.println("<body>");
              out.println("<p>Hi, your command was " + request.getParameter("command") + "!!!</p>");
              out.println("</body>");
              out.println("</html>");
              catch (Exception exc) {
                   System.err.println(exc.toString());
         else if (command.equals("play")) {
         else if (command.equals("bet")) {
         else if (command.equals("hit")) {
         else if (command.equals("stand")) {
         else if (command.equals("split")) {
         else if (command.equals("double")) {
         else if (command.equals("dealerdecision")) {
         else if (command.equals("reinvest")) {
         else if (command.equals("changebet")) {
         else if (command.equals("deal")) {
    package myblackjackpackage;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.lang.*;
    public class BlackjackDAO {
         private Connection myConn;
         public BlackjackDAO(String driver, String dbUrl, String userid, String passwrd)
                   throws IOException, ClassNotFoundException, SQLException {
              System.out.println("Loading driver: " + driver);
              Class.forName(driver);
              System.out.println("Connection to: " + dbUrl);
              myConn = DriverManager.getConnection(dbUrl, userid, passwrd);
              System.out.println("Connection successful!");
         public void addPlayer(HttpServletRequest request, HttpServletResponse response)
                   throws IOException, SQLException {
    //I've commented out all my code while debugging, so I didn't include
    //any here     
    compiler feedback
    C:\Tomcat4118\src\webapps\helloblackjack\src\myblackjackpackage>javac *.java -verbose
    [parsing started BlackjackDAO.java]
    [parsing completed 90ms]
    [parsing started BlackjackServlet.java]
    [parsing completed 10ms]
    [parsing started Player.java]
    [parsing completed 10ms]
    [loading c:\j2sdk14003\jre\lib\rt.jar(java/lang/Object.class)]
    [loading c:\j2sdk14003\jre\lib\rt.jar(java/sql/Connection.class)]
    [loading c:\j2sdk14003\jre\lib\rt.jar(java/lang/String.class)]
    [loading c:\j2sdk14003\jre\lib\rt.jar(java/io/IOException.class)]
    [loading c:\j2sdk14003\jre\lib\rt.jar(java/lang/ClassNotFoundException.class)]
    [loading c:\j2sdk14003\jre\lib\rt.jar(java/sql/SQLException.class)]
    [loading c:\tomcat4118\common\lib\servlet.jar(javax/servlet/http/HttpServletRequ
    est.class)]
    [loading c:\tomcat4118\common\lib\servlet.jar(javax/servlet/http/HttpServletResp
    onse.class)]
    [loading c:\tomcat4118\common\lib\servlet.jar(javax/servlet/http/HttpServlet.cla
    ss)]
    [loading c:\tomcat4118\common\lib\servlet.jar(javax/servlet/GenericServlet.class
    [loading c:\tomcat4118\common\lib\servlet.jar(javax/servlet/Servlet.class)]
    [loading c:\tomcat4118\common\lib\servlet.jar(javax/servlet/ServletConfig.class)
    [loading c:\j2sdk14003\jre\lib\rt.jar(java/io/Serializable.class)]
    [loading c:\tomcat4118\common\lib\servlet.jar(javax/servlet/ServletException.cla
    ss)]
    [checking myblackjackpackage.BlackjackDAO]
    [loading c:\j2sdk14003\jre\lib\rt.jar(java/lang/Throwable.class)]
    [loading c:\j2sdk14003\jre\lib\rt.jar(java/lang/Exception.class)]
    [loading c:\j2sdk14003\jre\lib\rt.jar(java/lang/System.class)]
    [loading c:\j2sdk14003\jre\lib\rt.jar(java/io/PrintStream.class)]
    [loading c:\j2sdk14003\jre\lib\rt.jar(java/io/FilterOutputStream.class)]
    [loading c:\j2sdk14003\jre\lib\rt.jar(java/io/OutputStream.class)]
    [loading c:\j2sdk14003\jre\lib\rt.jar(java/lang/Class.class)]
    [loading c:\j2sdk14003\jre\lib\rt.jar(java/sql/DriverManager.class)]
    [loading c:\j2sdk14003\jre\lib\rt.jar(java/util/Properties.class)]
    [loading c:\j2sdk14003\jre\lib\rt.jar(java/lang/Error.class)]
    [loading c:\j2sdk14003\jre\lib\rt.jar(java/lang/RuntimeException.class)]
    [loading c:\j2sdk14003\jre\lib\rt.jar(java/lang/StringBuffer.class)]
    [wrote BlackjackDAO.class]
    [checking myblackjackpackage.BlackjackServlet]
    [loading c:\tomcat4118\common\lib\servlet.jar(javax/servlet/ServletRequest.class
    BlackjackServlet.java:55: cannot resolve symbol
    symbol : method addPlayer (javax.servlet.http.HttpServletRequest,javax.servlet
    .http.HttpServletResponse)
    location: class myblackjackpackage.BlackjackServlet
    addPlayer(request, response);
    ^
    [loading c:\tomcat4118\common\lib\servlet.jar(javax/servlet/ServletResponse.clas
    s)]
    [loading c:\j2sdk14003\jre\lib\rt.jar(java/io/PrintWriter.class)]
    [loading c:\j2sdk14003\jre\lib\rt.jar(java/io/Writer.class)]
    [checking myblackjackpackage.Player]
    [total 580ms]
    1 error
    C:\Tomcat4118\src\webapps\helloblackjack\src\myblackjackpackage>
    and here's the ant feedback...
    C:\Tomcat4118\src\webapps\helloblackjack>ant all -verbose
    Ant version 1.4.1 compiled on October 11 2001
    Buildfile: build.xml
    Detected Java version: 1.4 in: c:\j2sdk14003\jre
    Detected OS: Windows 2000
    parsing buildfile C:\Tomcat4118\src\webapps\helloblackjack\build.xml with URI =
    file:C:/Tomcat4118/src/webapps/helloblackjack/build.xml
    Project base dir set to: C:\Tomcat4118\src\webapps\helloblackjack
    Build sequence for target `all' is [clean, prepare, compile, all]
    Complete build sequence is [clean, prepare, compile, all, javadoc, deploy, dist]
    clean:
    [delete] Deleting directory C:\Tomcat4118\src\webapps\helloblackjack\build
    [delete] Deleting C:\Tomcat4118\src\webapps\helloblackjack\build\images\a_s.g
    if
    [delete] Deleting C:\Tomcat4118\src\webapps\helloblackjack\build\images\q_s.g
    if
    [delete] Deleting directory C:\Tomcat4118\src\webapps\helloblackjack\build\im
    ages
    [delete] Deleting C:\Tomcat4118\src\webapps\helloblackjack\build\index.html
    [delete] Deleting C:\Tomcat4118\src\webapps\helloblackjack\build\newplayer.ht
    ml
    [delete] Deleting C:\Tomcat4118\src\webapps\helloblackjack\build\WEB-INF\clas
    ses\myblackjackpackage\BlackjackDAO.class
    [delete] Deleting directory C:\Tomcat4118\src\webapps\helloblackjack\build\WE
    B-INF\classes\myblackjackpackage
    [delete] Deleting directory C:\Tomcat4118\src\webapps\helloblackjack\build\WE
    B-INF\classes
    [delete] Deleting C:\Tomcat4118\src\webapps\helloblackjack\build\WEB-INF\web.
    xml
    [delete] Deleting directory C:\Tomcat4118\src\webapps\helloblackjack\build\WE
    B-INF
    [delete] Deleting directory C:\Tomcat4118\src\webapps\helloblackjack\build
    prepare:
    [mkdir] Created dir: C:\Tomcat4118\src\webapps\helloblackjack\build
    [copy] images\a_s.gif added as C:\Tomcat4118\src\webapps\helloblackjack\bui
    ld\images\a_s.gif doesn't exist.
    [copy] images\q_s.gif added as C:\Tomcat4118\src\webapps\helloblackjack\bui
    ld\images\q_s.gif doesn't exist.
    [copy] index.html added as C:\Tomcat4118\src\webapps\helloblackjack\build\i
    ndex.html doesn't exist.
    [copy] newplayer.html added as C:\Tomcat4118\src\webapps\helloblackjack\bui
    ld\newplayer.html doesn't exist.
    [copy] WEB-INF\web.xml added as C:\Tomcat4118\src\webapps\helloblackjack\bu
    ild\WEB-INF\web.xml doesn't exist.
    [copy] omitted as C:\Tomcat4118\src\webapps\helloblackjack\build is up to
    date.
    [copy] images added as C:\Tomcat4118\src\webapps\helloblackjack\build\image
    s doesn't exist.
    [copy] WEB-INF added as C:\Tomcat4118\src\webapps\helloblackjack\build\WEB-
    INF doesn't exist.
    [copy] Copying 5 files to C:\Tomcat4118\src\webapps\helloblackjack\build
    [copy] Copying C:\Tomcat4118\src\webapps\helloblackjack\web\images\q_s.gif
    to C:\Tomcat4118\src\webapps\helloblackjack\build\images\q_s.gif
    [copy] Copying C:\Tomcat4118\src\webapps\helloblackjack\web\images\a_s.gif
    to C:\Tomcat4118\src\webapps\helloblackjack\build\images\a_s.gif
    [copy] Copying C:\Tomcat4118\src\webapps\helloblackjack\web\index.html to C
    :\Tomcat4118\src\webapps\helloblackjack\build\index.html
    [copy] Copying C:\Tomcat4118\src\webapps\helloblackjack\web\newplayer.html
    to C:\Tomcat4118\src\webapps\helloblackjack\build\newplayer.html
    [copy] Copying C:\Tomcat4118\src\webapps\helloblackjack\web\WEB-INF\web.xml
    to C:\Tomcat4118\src\webapps\helloblackjack\build\WEB-INF\web.xml
    compile:
    [mkdir] Created dir: C:\Tomcat4118\src\webapps\helloblackjack\build\WEB-INF\
    classes
    [javac] myblackjackpackage\BlackjackDAO.class skipped - don't know how to ha
    ndle it
    [javac] myblackjackpackage\BlackjackDAO.java added as C:\Tomcat4118\src\weba
    pps\helloblackjack\build\WEB-INF\classes\myblackjackpackage\BlackjackDAO.class d
    oesn't exist.
    [javac] myblackjackpackage\BlackjackServlet.java added as C:\Tomcat4118\src\
    webapps\helloblackjack\build\WEB-INF\classes\myblackjackpackage\BlackjackServlet
    .class doesn't exist.
    [javac] myblackjackpackage\Player.java added as C:\Tomcat4118\src\webapps\he
    lloblackjack\build\WEB-INF\classes\myblackjackpackage\Player.class doesn't exist
    [javac] Compiling 3 source files to C:\Tomcat4118\src\webapps\helloblackjack
    \build\WEB-INF\classes
    [javac] Using modern compiler
    [javac] Compilation args: -d C:\Tomcat4118\src\webapps\helloblackjack\build\
    WEB-INF\classes -classpath
    "C:\Tomcat4118\src\webapps\helloblackjack\build\WEB-I
    NF\classes;
    C:\tomcat4118\common\classes;
    C:\tomcat4118\common\lib\activation.jar;
    C:\tomcat4118\common\lib\ant.jar;
    C:\tomcat4118\common\lib\commons-collections.jar;
    C:\tomcat4118\common\lib\commons-dbcp.jar;
    C:\tomcat4118\common\lib\commons-logging-api.jar;
    C:\tomcat4118\common\lib\commons-pool.jar;
    C:\tomcat4118\common\lib\jasper-compiler.jar;
    C:\tomcat4118\common\lib\jasper-runtime.jar;
    C:\tomcat4118\common\lib\jdbc2_0-stdext.jar;
    C:\tomcat4118\common\lib\jndi.jar;
    C:\tomcat4118\common\lib\jta.jar;
    C:\tomcat4118\common\lib\mail.jar;
    C:\tomcat4118\common\lib\mysql_uncomp.jar;
    C:\tomcat4118\common\lib\naming-common.jar;
    C:\tomcat4118\common\lib\naming-factory.jar;
    C:\tomcat4118\common\lib\naming-resources.jar;
    C:\tomcat4118\common\lib\servlet.jar;
    C:\tomcat4118\common\lib\tools.jar;
    C:\j2sdk14003\lib\tools.jar;
    C:\tomcat4118\ant141\lib\servlet.jar;
    C:\tomcat4118\ant141\lib\jaxp.jar;
    C:\tomcat4118\ant141\lib\crimson.jar;
    C:\tomcat4118\ant141\lib\ant.jar;
    C:\Tomcat4118\src\webapps\helloblackjack;
    C:\mysql\jdbc_dvr\mm.mysql.jdbc-1.2c;
    C:\Program Files\SQLserverjdbcdriver\lib\msbase.jar;
    C:\Program Files\SQLserverjdbcdriver\lib\msutil.jar;
    C:\Program Files\SQLserverjdbcdriver\lib\mssqlserver.jar"
    -sourcepath C:\Tomcat4118\src\webapps\helloblackjack\src -g -O
    [javac] Files to be compiled:
    C:\Tomcat4118\src\webapps\helloblackjack\src\myblackjackpackage\BlackjackDAO
    .java
    C:\Tomcat4118\src\webapps\helloblackjack\src\myblackjackpackage\BlackjackSer
    vlet.java
    C:\Tomcat4118\src\webapps\helloblackjack\src\myblackjackpackage\Player.java
    [javac] C:\Tomcat4118\src\webapps\helloblackjack\src\myblackjackpackage\Blac
    kjackServlet.java:55: cannot resolve symbol
    [javac] symbol : method addPlayer (javax.servlet.http.HttpServletRequest,j
    avax.servlet.http.HttpServletResponse)
    [javac] location: class myblackjackpackage.BlackjackServlet
    [javac] addPlayer(request, response);
    [javac] ^
    [javac] 1 error
    BUILD FAILED
    C:\Tomcat4118\src\webapps\helloblackjack\build.xml:212: Compile failed, messages
    should have been provided.
    at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:559)
    at org.apache.tools.ant.Task.perform(Task.java:217)
    at org.apache.tools.ant.Target.execute(Target.java:184)
    at org.apache.tools.ant.Target.performTasks(Target.java:202)
    at org.apache.tools.ant.Project.executeTarget(Project.java:601)
    at org.apache.tools.ant.Project.executeTargets(Project.java:560)
    at org.apache.tools.ant.Main.runBuild(Main.java:454)
    at org.apache.tools.ant.Main.start(Main.java:153)
    at org.apache.tools.ant.Main.main(Main.java:176)
    Total time: 1 second
    C:\Tomcat4118\src\webapps\helloblackjack>

    yes!
    early on i tried: BlackjackDAO.addPlayer(request, response);
    instead of: theBlackjackDAO.addPlayer(request, response);
    you rock - thanks a ton

  • Cannot resolve symbol: method getCodeBase ()

    I`m creating a dice game that makes a sound when player wins or looses. Instaed I`m getting the following error message: Cannot resolve symbol: method getCodeBase (). I think this depends on the fact that I have a separate applet launcher but cannot figure out how to solve this, please help!!
    This is the applet launcher
    import javax.swing.*;
    import java.awt.*;
    // [MC] Public class DiceApplet
    public class DiceApplet extends JApplet
         // [MC] Constructor.
         public DiceApplet()
              // [MC] Sets the contentPane property. This method is called by the constructor.
              this.setContentPane(new DicePanel());
    This is the die class
    import java.awt.*;
    import javax.swing.*;
    // [MC] Public class Die
    public class Die extends JPanel
        // ======================================================================
        // [MC] Instance variable.
        private int myFaceValue;     // [MC] Value that shows on face of die.
        // [MC] End instance variable.
        // ======================================================================
        // [MC] Constructor.
        // [MC] Initialises die to blue background and initial roll.
        public Die()
              // [MC] Sets the background colour of the die to blue.
              setBackground(Color.blue);
              // [MC] Sets the foreground colour of the die to gray.
              setForeground(Color.gray);
              // [MC] Sets the border colour of the die to white.
              setBorder(BorderFactory.createMatteBorder(4, 4, 4, 4, Color.white));
              // [MC] Sets to random initial value.
              roll();
         }     // [MC] End constructor.
        // ======================================================================
        // [MC] Method roll.
        // [MC] Produces random roll in the range of 1 to 6.
        public int roll()
            int val = (int)(6*Math.random() + 1);   // [MC] Range from 1 to 6.
            setValue(val);
            return val;     // [MC] Returns a value from 1 to 6.
        }     // [MC] End method roll.
        // [MC] Method setValue
        // [MC] Sets the value of the die. Causes repaint.
        public void setValue(int dots)
            myFaceValue = dots;
            repaint();    // [MC] Value has changed, must repaint.
        } // [MC] End method setValue.
        // ======================================================================
        // [MC] Method getValue.
        // [MC] Returns result of last roll.
        public int getValue()
            return myFaceValue;
        } // [MC] End method getValue.
        // ======================================================================
        // [MC] Method paintComponent.
        // [MC] Draws dots of die face.
        public void paintComponent(Graphics g)
              // [MC] Call superclass's paint method.
            super.paintComponent(g);
              // [MC] Sets panel width.
            int w = getWidth();
            // [MC] Sets panel height.
            int h = getHeight();
              // [MC] Draws border.
            g.drawRect(0, 0, w-1, h-1);
            // Switch
            switch (myFaceValue)
                case 1: drawDot(g, w/2, h/2);
                        break;
                case 3: drawDot(g, w/2, h/2);
                case 2: drawDot(g, w/4, h/4);
                        drawDot(g, 3*w/4, 3*h/4);
                        break;
                case 5: drawDot(g, w/2, h/2);
                case 4: drawDot(g, w/4, h/4);
                        drawDot(g, 3*w/4, 3*h/4);
                        drawDot(g, 3*w/4, h/4);
                        drawDot(g, w/4, 3*h/4);
                        break;
                case 6: drawDot(g, w/4, h/4);
                        drawDot(g, 3*w/4, 3*h/4);
                        drawDot(g, 3*w/4, h/4);
                        drawDot(g, w/4, 3*h/4);
                        drawDot(g, w/4, h/2);
                        drawDot(g, 3*w/4, h/2);
                        break;
            } // [MC] End switch.
        }     // [MC] End method paintComponent.
        // [MC] Method drawDot.
        /** Utility method used by paintComponent(). */
        private void drawDot(Graphics g, int x, int y)
            // [MC] Gets panel width.
              int w = getWidth();
              // [MC] Gets panel height.
              int h = getHeight();
              // [MC] Local variable.
            int d;
            // [MC] Sets diameter of dot proportional to panel size.
            d = (w + h)/10;
              // [MC] Sets colour for dot to white.
              Color myDotColor = new Color(255, 255, 255);
              g.setColor(myDotColor);
             // [MC] Draws dot.
             g.fillOval(x-d/2, y-d/2, d, d);
        } // [MC] End method drawDot.
    This is the class giving the error message
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.border.*;
    import java.applet.AudioClip;
    import java.applet.Applet;
    import java.net.*;
    // [MC] Public class DicePanel
    public class DicePanel extends JPanel
        // ======================================================================
        // [MC] Instance variables.
        // [MC] Creates new instances of the component for the die.
        private Die myLeftDie;     // [MC] Component for left die.
        private Die myRightDie;     // [MC] Component for right die.
         // [MC] Creates the button (rollButton) to roll the dice.
         private     JButton rollButton = new JButton("Roll Dice");
         // [MC] Creates the text fields. Creates new instance of JTextField.
         // [MC] Creates the text field (rollNumberTextField) to display number of rolls.
         private JTextField rollNumberTextField = new JTextField(20);
         // [MC] Creates the text field (rollResultTextField) to display result of roll.
         private JTextField rollResultTextField = new JTextField(20);
         // [MC] Creates the text field (rollPointsTextField) to display the player`s points.
         private JTextField rollPointsTextField = new JTextField(20);
         // [MC] Creates the text field (gameFinalResultTextField) to display the final game result.
         private JTextField gameFinalResultTextField = new JTextField(20);
        // [MC] Initialises instance variables declared in the inner listeners.
        private int result = 0, resultLeft = 0, resultRight = 0;
         private int rolls = 0;
         private int finalResult = 0;
         private int points = 0;
         private boolean first = true;
         private AudioClip winClip = null;
         private AudioClip looseClip = null;
        // ======================================================================
        // [MC] Constructor. Creates border layout panel.
        DicePanel()
            // [MC] Creates the dice
            myLeftDie  = new Die();
            myRightDie = new Die();
        // ======================================================================
              // [MC] Creates the buttons.
              // [MC] Creates the button (newGameButton) to start new game.
            JButton newGameButton = new JButton("New Game");
              // *[MC] Creates the button (rollButton) to roll the dice.
            // *JButton rollButton = new JButton("Roll Dice");
            // [MC] Sets the font of the buttons.
            // [MC[ Sets the font of the button newGameButton.
            newGameButton.setFont(new Font("Batang", Font.BOLD, 20));
            // [MC[ Sets the font of the button rollButton.
            rollButton.setFont(new Font("Batang", Font.BOLD, 20));
                // [MC] Sets the button border format.
              // [MC] Sets the button with compound borders.
            Border compound;
              // [MC] Border format local variables.
            Border blackline, raisedetched, loweredetched, raisedbevel, loweredbevel, empty;
              // [MC] Initialises border formats.
              //blackline = BorderFactory.createLineBorder(Color.gray);
              raisedetched = BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
              loweredetched = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
              raisedbevel = BorderFactory.createRaisedBevelBorder();
              //loweredbevel = BorderFactory.createLoweredBevelBorder();
              // [MC] Sets compound border format.
            compound = BorderFactory.createCompoundBorder(raisedetched, raisedbevel);
            // [MC] Sets the button (newGameButton) with compound border format.
            newGameButton.setBorder(compound);
            // [MC] Sets the button (rollButton) with compound border format.
              rollButton.setBorder(compound);
            // [MC] Adds listener.
            // [MC] Adds listener to rollButton.
            rollButton.addActionListener(new RollListener());
            // [MC] Adds listener to newGameButton.
            newGameButton.addActionListener(new NewGameListener());
        // ======================================================================
              // [MC] Creates the labels. Creates new instance of JLabel.
              // [MC] Creates the label (rollNumberLabel) for the number of rolls.
              JLabel rollNumberLabel = new JLabel("Roll Number");
              // [MC] Creates the label (rollResultLabel) for the result of roll.
              JLabel rollResultLabel = new JLabel("Roll Result");
              // [MC] Creates the label (rollPointsLabel) for the player`s points.
              JLabel rollPointsLabel = new JLabel("Player Points");
              // [MC] Creates the label (gameFinalResult) for the final game result.
              JLabel gameFinalResultLabel = new JLabel("Final Result");
              // [MC] Sets the label font.
              rollNumberLabel.setFont(new Font("Sansserif", Font.PLAIN, 10));
              rollResultLabel.setFont(new Font("Sansserif", Font.PLAIN, 10));
              rollPointsLabel.setFont(new Font("Sansserif", Font.PLAIN, 10));
              gameFinalResultLabel.setFont(new Font("Sansserif", Font.PLAIN, 10));
              // [MC] Sets the label title alignment.
              rollNumberLabel.setHorizontalAlignment(JLabel.CENTER);
              rollResultLabel.setHorizontalAlignment(JLabel.CENTER);
              rollPointsLabel.setHorizontalAlignment(JLabel.CENTER);
              gameFinalResultLabel.setHorizontalAlignment(JLabel.CENTER);
              // [MC] Sets the label border format.
              //rollNumberLabel.setBorder(loweredetched);
              //rollResultLabel.setBorder(loweredetched);
              //rollPointsLabel.setBorder(loweredetched);
              //gameFinalResultLabel.setBorder(loweredetched);
        // ======================================================================
              // [MC] Sets the text field font.
              rollNumberTextField.setFont(new Font("Sansserif", Font.PLAIN, 16));
              rollResultTextField.setFont(new Font("Sansserif", Font.PLAIN, 16));
              rollPointsTextField.setFont(new Font("Sansserif", Font.PLAIN, 16));
              gameFinalResultTextField.setFont(new Font("Sansserif", Font.BOLD, 16));
              // [MC] Sets the text field text alignment.
              rollNumberTextField.setHorizontalAlignment(JTextField.CENTER);
              rollResultTextField.setHorizontalAlignment(JTextField.CENTER);
              rollPointsTextField.setHorizontalAlignment(JTextField.CENTER);
              gameFinalResultTextField.setHorizontalAlignment(JTextField.CENTER);
              // [MC] Sets the text field text colour.
              gameFinalResultTextField.setForeground(Color.blue);
              // [MC] Sets the text field to not editable.
              rollNumberTextField.setEditable(false);
              rollResultTextField.setEditable(false);
              rollPointsTextField.setEditable(false);
              gameFinalResultTextField.setEditable(false);
        // ======================================================================
              // [MC] Gets sounds.
              winClip =  getAudioClip(getCodeBase(), "bunny1.au");
              looseClip =  getAudioClip(getCodeBase(), "bunny1.au");
        // ======================================================================
              // [MC] Sets the layout manager (GridBagLayout) for this container.
              this.setLayout(new GridBagLayout());
              // [MC] Creates new instance of GridBagConstraints.
              GridBagConstraints c = new GridBagConstraints();
              // [MC] Makes the component fill its display area entirely.
              c.fill = GridBagConstraints.BOTH;
              // [MC] Layouts components.
              // [MC] Adds the component newGameButton to this container.
              c.gridx = 0;     // [MC] Makes this component the leftmost column (column 1).
              c.gridy = 0;     // [MC] Makes this component the uppermost row (row 1).
              c.gridheight = 1;     // [MC] Specifies the number of rows the component uses (1 row).
              c.gridwidth = 2;     // [MC] Specifies the number of columns the component uses (2 columns).
              this.add(newGameButton, c);     // [MC] Adds the button newGameButton.
              // [MC] Adds the component rollButton to this container.
              c.gridx = 2;     // [MC] Makes this component the third column from left (column 3).
              c.gridy = 0;     // [MC] Make this component the uppermost row (row 1).
              c.gridheight = 1;     // [MC] Specifies the number of rows the component uses (1 rows).
              c.gridwidth = 2;     // [MC] Specifies the number of columns the component uses (2 columns).
              this.add(rollButton, c);     // [MC] Adds the button rollButton.
              // [MC] Adds the component rollNumberLabel to this container.
              c.gridx = 0;     // [MC] Makes this component the leftmost column (column 1).
              c.gridy = 3;     // [MC] Makes this component the third row from top (row 3).
              c.gridheight = 1;     // [MC] Specifies the number of rows the component uses (1 row).
              c.gridwidth = 1;     // [MC] Specifies the number of columns the component uses (1 column).
              c.weightx = 0.1;     // [MC] Requests any extra vertical (column) space.
              this.add(rollNumberLabel, c);     // [MC] Adds the label rollNumberLabel.
              // [MC] Adds the component rollResultLabel to this container.
              c.gridx = 1;     // [MC] Makes this component the second column from left (column 2).
              c.gridy = 3;     // [MC] Makes this component the third row from top (row 3).
              c.gridheight = 1;     // [MC] Specifies the number of rows the component uses (1 row).
              c.gridwidth = 1;     // [MC] Specifies the number of columns the component uses (1 column).
              this.add(rollResultLabel, c);     // [MC] Adds the label rollResultLabel.
              // [MC] Adds the component rollPointsLabel to this container.
              c.gridx = 2;     // [MC] Makes this component the third column from left (column 3).
              c.gridy = 3;     // [MC] Makes this component the third row from top (row 3).
              c.gridheight = 1;     // [MC] Specifies the number of rows the component uses (1 row).
              c.gridwidth = 1;     // [MC] Specifies the number of columns the component uses (1 column).
              this.add(rollPointsLabel, c);     // [MC] Adds the label rollPointsLabel.
              // [MC] Adds the component gameFinalResultLabel to this container.
              c.gridx = 3;     // [MC] Makes this component the fourth column from left (column 4).
              c.gridy = 3;     // [MC] Makes this component the third row from top (row 3).
              c.gridheight = 1;     // [MC] Specifies the number of rows the component uses (1 row).
              c.gridwidth = 1;     // [MC] Specifies the number of columns the component uses (1 column).
              this.add(gameFinalResultLabel, c);     // [MC] Adds the label gameFinalResultLabel.
              // [MC] Adds the component rollNumberTextField to this container.
              c.gridx = 0;     // [MC] Makes this component the leftmost column (column 1).
              c.gridy = 4;     // [MC] Makes this component the fourth row from top (row 4).
              c.gridheight = 1;     // [MC] Specifies the number of rows the component uses (1 row).
              c.gridwidth = 1;     // [MC] Specifies the number of columns the component uses (1 column).
              c.weightx = 0.1;     // [MC] Requests any extra vertical (column) space.
              this.add(rollNumberTextField, c);     // [MC] Adds the text field rollNumberTextField.
              // [MC] Adds the component rollResultTextField to this container.
              c.gridx = 1;     // [MC] Makes this component the second column from left (column 2).
              c.gridy = 4;     // [MC] Makes this component the fourth row from top (row 4).
              c.gridheight = 1;     // [MC] Specifies the number of rows the component uses (1 row).
              c.gridwidth = 1;     // [MC] Specifies the number of columns the component uses (1 column).
              this.add(rollResultTextField, c);     // [MC] Adds the text field rollResultTextField.
              // [MC] Adds the component rollPointsTextField to this container.
              c.gridx = 2;     // [MC] Makes this component the third column from left (column 3).
              c.gridy = 4;     // [MC] Makes this component the fourth row from top (row 4).
              c.gridheight = 1;     // [MC] Specifies the number of rows the component uses (1 row).
              c.gridwidth = 1;     // [MC] Specifies the number of columns the component uses (1 column).
              this.add(rollPointsTextField, c);     // [MC] Adds the text field rollPointsTextField.
              // [MC] Adds the component gameFinalResultTextField to this container.
              c.gridx = 3;     // [MC] Makes this component the fourth column from left (column 4).
              c.gridy = 4;     // [MC] Makes this component the fourth row from top (row 4).
              c.gridheight = 1;     // [MC] Specifies the number of rows the component uses (1 row).
              c.gridwidth = 1;     // [MC] Specifies the number of columns the component uses (1 column).
              this.add(gameFinalResultTextField, c);     // [MC] Adds the text field gameFinalResultTextField.
              // [MC] Adds the component myLeftDie to this container.
              c.gridx = 0;     // [MC] Makes this component the leftmost column (column 1).
              c.gridy = 1;     // [MC] Makes this component the second row from top (row 2).
              c.gridheight = 2;     // [MC] Specifies the number of rows the component uses (2 rows).
              c.gridwidth = 2;     // [MC] Specifies the number of columns the component uses (2 columns).
              c.weightx = 1.0;     // [MC] Requests any extra vertical (column) space.
              c.weighty = 1.0;     // [MC] Requests any extra horizontal (row) space.
              this.add(myLeftDie, c);     // [MC] Adds the component myLeftDie.
              // [MC] Adds the component myRightDie to this container.
              c.gridx = 2;     // [MC] Makes this component the third column from left (column 3).
              c.gridy = 1;     // [MC] Makes this component the second row from top (row 2).
              c.gridheight = 2;     // [MC] Specifies the number of rows the component uses (2 rows).
              c.gridwidth = 2;     // [MC] Specifies the number of columns the component uses (2 column).
              c.weightx = 1.0;     // [MC] Requests any extra column (vertical) space.
              c.weighty = 1.0;     // [MC] Requests any extra horizontal (row) space.
              this.add(myRightDie, c);     // [MC] Adds the component myRightDie.
        }     // [MC] end constructor
        // ======================================================================
        // [MC] Private class RollListener
        // [MC] Inner listener class for rollButton.
        private class RollListener implements ActionListener
            public void actionPerformed(ActionEvent e)
                // [MC] Rolls the dice.
                myLeftDie.roll();     // [MC] Rolls left die.
                myRightDie.roll();     // [MC] Rolls right die.
                   finalResult = 0; // [MC] If result = 0 then game is not over.
                   rolls++;     // [MC] Increments the number of rolls.
                  // [MC] Displays the roll number.
                    rollNumberTextField.setText(" " + rolls + " ");
                   // [MC] Returns the result (number of dots) of last roll.
                   resultLeft = myLeftDie.getValue();     // [MC] Returns the result of the left die.
                   resultRight = myRightDie.getValue();     // [MC] Returns the result of the right die.
                   result = resultLeft + resultRight;     // [MC] Returns the total result of dice.
                   // [MC] Displays the result of last roll.
                   rollResultTextField.setText(" " + result + " ");
                   // [MC] Sets the rules for the game.
                   // [MC] Sets the rules for the first roll of dice.
                   if (first)
                       // [MC] If the result is 2, 3 or 12 on the first throw, the player loses.
                       if (result == 2 || result == 3 || result == 12)
                             finalResult = 2; // [MC] If result = 2 then the player loses and the game is over.
                             gameFinalResultTextField.setText("LOOSE");
                             Toolkit.getDefaultToolkit().beep();
                           rollButton.setEnabled(false);     // [MC] Disable rollButton.
                             first = true; // [MC] Game over after first roll.
                       // [MC] If the result is 7 or 11 on the first throw, the player wins.
                        else if (result == 7 || result == 11)
                             finalResult = 1; // [MC] If result = 1 then the player wins and the game is over.
                             gameFinalResultTextField.setText("WIN");
                             //Toolkit.getDefaultToolkit().beep();
                           rollButton.setEnabled(false);     // [MC] Disable rollButton.
                             first = true;     // [MC] Game over after first roll.
                        // [MC] If the player didn`t win or lose then the results 4, 5, 6, 8, 9 or 10 become the player`s point.
                        else if (result == 4 || result == 5 || result == 6 || result == 8 || result == 9 || result == 10);
                             // [MC] Returns the player`s points.
                             points = result;     // [MC] Returns the player`s points.
                             // [MC] Displays the player`s points.
                             rollPointsTextField.setText(" " + points + " ");
                             first = false;     // [MC] Game is not over after first roll.
                   // [MC] Sets the rules for the next rolls (from second roll onwards) of the dice.
                   // [MC] If the result is 7, then the player loses.
                   else if (result == 7)
                        finalResult = 2;     // [MC] If result = 2 then the player loses and the game is over.
                        gameFinalResultTextField.setText("LOOSE");
                        Toolkit.getDefaultToolkit().beep();
                      rollButton.setEnabled(false);     // [MC] Disable rollButton.
                   // [MC] If the result is equal to the player`s point, then the player wins.
                   else if (result == points)
                        finalResult = 1;     // [MC] If result = 1 then the player wins and the game is over.
                        gameFinalResultTextField.setText("WIN");
                        winClip.play();
                        //Toolkit.getDefaultToolkit().beep();
                      rollButton.setEnabled(false);     // [MC] Disable rollButton.
              }     // [MC] End public void actionPerformed(ActionEvent e).
         }     // [MC] End private class RollListener.
        // ======================================================================
        // [MC] Private class NewGameListener
        // [MC] Inner listener class for newGameButton.
        private class NewGameListener implements ActionListener
              public void actionPerformed(ActionEvent e)
                   // [MC] Initialises instance variables.
                   first = true;     // [MC] Initialise dice roll to first roll.
                   rolls = 0;     // [MC] Initialises number of rolls to 0.
                   // [MC] Initialises text fields.
                   rollResultTextField.setText("");
                   rollNumberTextField.setText("");
                   rollPointsTextField.setText("");
                   gameFinalResultTextField.setText("");
                   rollButton.setEnabled(true);     // [MC] Enable rollButton.
            } // [MC] End public void actionPerformed(ActionEvent e).
         }// [MC] End private class NewGameListener implements ActionListener.
    } // [MC] End public class DicePanel extends JPanel.

    make a backup copy before these changes
    it now compiles, but I haven't run/tested it
    changed constructor to init(), extending Applet, not JApplet
    // [MC] Public class DiceApplet
    public class DiceApplet extends Applet
      // [MC] Constructor.
      public void init()
        // [MC] Sets the contentPane property. This method is called by the constructor.
        add(new DicePanel());
    }then the 'error lines' become
        winClip =  ((Applet)getParent()).getAudioClip(((Applet)getParent()).getCodeBase(), "bunny1.au");
        looseClip =  ((Applet)getParent()).getAudioClip(((Applet)getParent()).getCodeBase(), "bunny1.au");there might be additional problems when you run/test it, but this might get you started

  • "cannot resolve symbol" when compiling a class that calls methods

    I am currently taking a Intro to Java class. This problem has my instructor baffled. If I have two classes saved in separate files, for example:
    one class might contain the constructor with get and set statements,
    the other class contains the main() method and calls the constructor.
    The first file compiles clean. When I compile the second file, I get the "cannot resolve symbol error" referring to the first class.
    If I copy both files to floppy and take them to school. I can compile and run them with no problem.
    If I copy the constructor file to the second file and delete the "public" from the class declaration of the constructor, it will compile and run at home.
    At home, I am running Windows ME. At school, Windows 2000 Professional.
    The textbook that we are using came with a CD from which I downloaded the SDK and Runtime Environment. I have tried uninstalling and reinstalling. I have also tried downloading directly from the Sun website and still the error persists.
    I came across a new twist tonight. I copied class files from the CD to my hard drive. 4 separate files. 3 of which are called by the 4th.
    I can run these with no problem.
    Any ideas, why I would have compile errors????
    Thanks!!

    Oooops ... violated....
    Well first a constructor should have the same name as the class name so in our case what we have actually created is a static method statementOfPhilosophy() in class SetUpSite and not a constructor.
    Now why does second class report unresolved symbol ???
    Look at this line
    Class XYZ=new XYZ();
    sounds familiar, well this is what is missing from your second class, since there is no object how can it call a method ...
    why the precompiled classes run is cuz they contain the right code perhaps so my suggestion to you is,
    1) Review the meaning and implementation of Constructors
    2) Ask your instructor to do the same ( no pun intended ... )
    3) Check out this for understanding PATH & CLASSPATH http://www.geocities.com/gaurav007_2000/java/
    4) Look at the "import" statement, when we have code in different files and we need to incorporate some code in another it is always a good idea to use import statement, that solves quite a few errors.
    5) Finally forgive any goof up on this reply, I have looked at source code after 12 months of hibernation post dot com doom ... so m a bit rusty... shall get better soon though :)
    warm regards and good wishes,
    Gaurav
    CW :-> Mother of all computer languages.
    I HAM ( Radio-Active )
    * OS has no significance in this error
    ** uninstalling and reinstalling ? r u nuttttttts ??? don't ever do that again unless your compiler fails to start, as long as it is giving a valid error it is working man ... all we need to do is to interpret the error and try to fix the code not the machine or compiler.

  • Cannot resolve name

    Hi:
    I am trying to install Sun One Directory Distribution version 5.2 on my computer.
    My computer name is "albertlam".
    My workgroup is "workgroup2".
    I tried the following for fully qualified computer name:
    albertlam.workgroup2
    But it gives me an error:cannot resolve name
    Yours,
    Frustrated.

    Hi,
    Your issue is that you are not able to resolve the DNS name.
    and more over you have not given the correct fully qualified computer name:
    To find the same right click on your 'my computer' and reach properties and you'll see a tab 'network identification' and i that you can see your fully qualified computer name.
    copy the same and use in place..it should hopefully work.

  • DiveLog Tutorial - Cannot resolve Symbol

    I am having a problem with the DiveLog Tutorial getting the basic code to compile. This is sepcifically on Solaris 2.8 with Java 1.3.1.
    I have entered all of the code from Part 1, and have removed all of the syntax errors. (More on this later). I run the Javac command, as directed in the tutorial for Solaris, and I get 6 errors - one for each of the 6 subroutines called - for example it can't resolve "Resources.class". Now thre is a Resources.java, but the javac step will not copmpile. it. So I ran the javac command against Resources.java, and it compiled cleanly, and created the Resources.class file. I reran the javac against DiveLog.java, but it still cannot resolve Resoources.class. All of these files are in the same directory.
    Just to be sure, I downloaded the sample code, and tried to compile it. Same problem. I then downloaded a copy of the DiveLog application that will compile under Windows. Same problem.
    From what I can see, the compiler does not seem to be looking in the directory the command is executed from to resolve any references. In otherwords - my current working directory is divelog; it contains 7 java files needed for this tutorial. Initially, there was no default classpath set; so i have tried various combinations of CLASSPATH statements, including setting the source directory and the regular classpath. Nothing seems to work.
    Anyone have a suggestion on what's wrong here? All of the entries in the forum that I have found relate to WIndows, and not Solaris.
    Thanks in advance.
    Jerry Lawson

    From what I can see, the compiler does not seem to be
    looking in the directory the command is executed from
    to resolve any references. To find classes, javac uses the fully qualified class name and searches through the Classpath directories. I know almost nothing about Solaris, but this functionality is the same for all Java platforms, to my knowledge.
    Fully qualified means the package name plus the class name. If you have followed the tutorial, you should have these .java files in a directory named divelog and you should have "package divelog;" at the start of each source code file. So, javac is looking for a directory named divelog that contains files with the classes in them.
    It might be a simple fix to "cd .." and compile from the directory that contains the divelog directory. Then, assuming the Classpath includes the current directory, javac will look in the current directory for a directory named divelog that contains your .class or .java files.
    Otherwise, you need to get the directory 'above' divelog in your Classpath.

  • Illegal start of expression and cannot resolve symbol HELP

    Can someone pls help me?
    These are the two problems:
    --------------------Configuration: j2sdk1.4.1_02 <Default>--------------------
    C:\Documents and Settings\Laila\My Documents\CMT2080\Coursework\Game\Mindboggler.java:291: illegal start of expression
    public void inputJButtonActionPerformed( ActionEvent event )
    ^
    C:\Documents and Settings\Laila\My Documents\CMT2080\Coursework\Game\Mindboggler.java:285: cannot resolve symbol
    symbol: method inputJButtonActionPerformed (java.awt.event.ActionEvent)
                   inputJButtonActionPerformed( event);
    Here is my code :
    //Mind boggler quiz
    //Marcelyn Samson
    import java.awt.*;
    import java.awt.event.*;
    import java.text.DecimalFormat;
    import javax.swing.*;
    import javax.swing.border.*;
    import java.lang.*;
    public class Mindboggler extends JFrame
              // JPanel for welcome window
              private JPanel welcomeJPanel;
              private JPanel presetJPanel;
         private JLabel titleJLabel;
         private JLabel quizJLabel;
         private JLabel girlJLabel, headJLabel;
         private JLabel introJLabel;
         private JButton startJButton;
         // JPanel for questionone window
         private JPanel questiononeJPanel;
         private JLabel textJLabel;
         private JPanel becksJPanel;
         private JButton oneJButton, twoJButton, threeJButton, fourJButton, nextJButton;
              //JPanel for questiontwo window
              private JPanel questiontwoJPanel;
              private JPanel orlandoJPanel;
              private JLabel q2JLabel;
              private JCheckBox lordJCheckBox;
              private JCheckBox faceJCheckBox;
              private JCheckBox piratesJCheckBox;
              private JButton next2JButton;
         private JButton inputJButton;
         //JPanel for questionthree
         private JPanel questionthreeJPanel;
         private JPanel howmuchJPanel;
         private JLabel howmuchJLabel;
         private JLabel nameJLabel;
         private JTextField nameJTextField;
         private JLabel moneyJLabel;
         private JTextField moneyJTextField;
         private JButton next3JButton;
         //Publics
         public JPanel welcomeJFrame, questionJFrame, questiontwoJFrame, questionthreeJFrame;
         //contentPane
              public Container contentPane;
              //no argument constructor
              public Mindboggler()
                   createUserInterface();
              //create and position components
              private void createUserInterface()/////////////////////////; semo colon do not edit copy paste
                   //get contentPane and set layout to null
                   contentPane = getContentPane();
                   contentPane.setLayout ( null );
                   welcome();
                   //set properties of applications window
                   setTitle( "Mindboggler" ); // set JFrame's title bar string
              setSize( 600, 400 ); // set width and height of JFrame
              setVisible( true ); // display JFrame on screen
              } // end method createUserInterface
              public void welcome(){
                        // set up welcomeJPanel
                   welcomeJPanel = new JPanel();
                   welcomeJPanel.setLayout( null );
                   welcomeJPanel.setBounds(0, 0, 600, 400);
                   welcomeJPanel.setBackground( Color.GREEN );
                   // set up textJLabel
                   titleJLabel = new JLabel();
                   titleJLabel.setText( "Mind Boggler" );
                   titleJLabel.setLocation( 30, 10);
                   titleJLabel.setSize( 550, 70);
                   titleJLabel.setFont( new Font( "SansSerif", Font.PLAIN, 30 ) );
                   titleJLabel.setHorizontalAlignment( JLabel.CENTER );
                   welcomeJPanel.add( titleJLabel );
                   // set up presetJPanel
                   presetJPanel = new JPanel();
                   presetJPanel.setLayout( null );
                   presetJPanel.setBounds( 150, 10, 300, 80 );
                   presetJPanel.setBackground( Color.GRAY );
                   welcomeJPanel.add( presetJPanel );
                   //setup Intro JLabel
                   introJLabel = new JLabel();
                   introJLabel.setText( "Think, think, think. Can you get all the questions right?" );
                   introJLabel.setBounds( 40, 100, 500, 200 );
                   introJLabel.setFont( new Font( "SansSerif", Font.PLAIN, 18 ) );
                   introJLabel.setHorizontalAlignment( JLabel.CENTER );
                   welcomeJPanel.add(introJLabel);
                   //set up head JLabel
                   headJLabel = new JLabel();
                   headJLabel.setIcon( new ImageIcon( "head.jpeg") );
                   headJLabel.setBounds( 540, 5, 40, 160 );
                   headJLabel.setHorizontalAlignment( JLabel.CENTER );
                   welcomeJPanel.add(headJLabel);
                        //setup girlJLabel
                   girlJLabel = new JLabel();
                   girlJLabel.setIcon( new ImageIcon( "girl.Jjpeg") );
                   girlJLabel.setBounds( 5, 10, 60, 100 );
                   girlJLabel.setHorizontalAlignment( JLabel.CENTER );
                   welcomeJPanel.add(girlJLabel);
                        //set up startJbutton
                   startJButton = new JButton();
                   startJButton.setText( "Start" );
                   startJButton.setBounds(250, 300, 100, 30);
                   startJButton.setFont( new Font( "SansSerif", Font.BOLD, 14) );
                   welcomeJPanel.add(startJButton);
                   contentPane.add(welcomeJPanel);
                   startJButton.addActionListener(
                        new ActionListener(){
                             public void actionPerformed(ActionEvent e){
                                  question();
              public void question()
                   //set up question one JPanel
                   welcomeJPanel.setVisible(false);
                   questiononeJPanel = new JPanel();
         questiononeJPanel.setLayout( null );
              questiononeJPanel.setBounds(0, 0, 600,400);
              questiononeJPanel.setBackground( Color.GREEN );
              // set up textJLabel
              textJLabel = new JLabel();
              textJLabel.setText( "Who did Beckham supposedly cheat with?" );
              textJLabel.setLocation( 20, 20);
              textJLabel.setSize( 550, 70);
              textJLabel.setFont( new Font( "SansSerif", Font.BOLD, 20 ) );
              textJLabel.setHorizontalAlignment( JLabel.CENTER );
              questiononeJPanel.add( textJLabel );
                   // set up presetJPanel
              becksJPanel = new JPanel();
              becksJPanel.setLayout( null );
              becksJPanel.setBorder( new TitledBorder(
         "Question 1" ) );
              becksJPanel.setBounds( 10, 10, 570, 80 );
              becksJPanel.setBackground( Color.GRAY );
              questiononeJPanel.add( becksJPanel );
                   // set up oneJButton
              oneJButton = new JButton();
              oneJButton.setBounds( 10, 120, 300, 40 );
              oneJButton.setText( "Britney Spears" );
              oneJButton.setBackground( Color.ORANGE );
              questiononeJPanel.add( oneJButton );
              // set up twoJButton
              twoJButton = new JButton();
              twoJButton.setBounds( 10, 180, 300, 40 );
              twoJButton.setText( "Meg Ryan" );
              twoJButton.setBackground( Color.ORANGE );
              questiononeJPanel.add( twoJButton );
              // set up threeJButton
              threeJButton = new JButton();
              threeJButton.setBounds( 10, 240, 300, 40 );
              threeJButton.setText( "Rebecca Loos" );
              threeJButton.setBackground( Color.ORANGE );
              questiononeJPanel.add( threeJButton );
              // set up fourJButton
              fourJButton = new JButton();
              fourJButton.setBounds( 10, 300, 300, 40 );
              fourJButton.setText( "Angelina Jolie" );
              fourJButton.setBackground( Color.ORANGE );
              questiononeJPanel.add( fourJButton );
                   // set up nextJButton
                   nextJButton = new JButton();
                   nextJButton.setBounds ( 375, 300, 150, 40 );
                   nextJButton.setText("Next");
                   nextJButton.setBackground( Color.GRAY );
                   questiononeJPanel.add( nextJButton );
                   contentPane.add(questiononeJPanel);
              nextJButton.addActionListener(
                        new ActionListener(){
                             public void actionPerformed(ActionEvent e){
                                  questiontwo();
              public void questiontwo()
                   //set up question two JPanel
                   questiononeJPanel.setVisible(false);
                   questiontwoJPanel=new JPanel();
                   questiontwoJPanel.setLayout(null);
                   questiontwoJPanel.setBounds(0, 0, 600, 400);
                   questiontwoJPanel.setBackground( Color.GREEN );
                   // set up q2JLabel
              q2JLabel = new JLabel();
              q2JLabel.setBounds( 20, 20, 550, 70 );
              q2JLabel.setText( "What films has Orlando Bloom starred in?" );
              q2JLabel.setFont(new Font( "SansSerif", Font.BOLD, 20 ) );
         q2JLabel.setHorizontalAlignment( JLabel.CENTER );
    questiontwoJPanel.add(q2JLabel);
    //set up orlandoJPanel
    orlandoJPanel = new JPanel();
    orlandoJPanel.setLayout(null);
    orlandoJPanel.setBorder( new TitledBorder("Question 2"));
    orlandoJPanel.setBounds( 10, 10, 570, 80);
    orlandoJPanel.setBackground(Color.GRAY);
    questiontwoJPanel.add(orlandoJPanel);
    // set up lordJCheckBox
              lordJCheckBox = new JCheckBox();
              lordJCheckBox.setBounds( 16, 112, 200, 24 );
              lordJCheckBox.setText( "1. Lord of The Rings" );
              questiontwoJPanel.add( lordJCheckBox );
                   // set up faceJCheckBox
              faceJCheckBox = new JCheckBox();
              faceJCheckBox.setBounds( 16, 159, 200, 24 );
              faceJCheckBox.setText( "2. Face Off" );
              questiontwoJPanel.add( faceJCheckBox );
              // set up piratesJCheckBox
              piratesJCheckBox = new JCheckBox();
              piratesJCheckBox.setBounds( 16, 206, 200, 24 );
              piratesJCheckBox.setText( "3. Pirates of The Caribean" );
              questiontwoJPanel.add( piratesJCheckBox );
              // set up inputJButton
              inputJButton = new JButton();
              inputJButton.setBounds(20, 256, 200, 21 );
              inputJButton.setText( "Input answer" );
              questiontwoJPanel.add( inputJButton );
    inputJButton.addActionListener(
         new ActionListener()
              //event handler called when user clicks inputJButton
              public void actionPerformed( ActionEvent event )
                   inputJButtonActionPerformed( event);
    //show JOptionMessages when user clicks on JCheckBoxes and inputJButton
    public void inputJButtonActionPerformed( ActionEvent event )
         //display error message if no JCheckBoxes is checked
         if ( ( !lordJCheckBox.isSelected() && !faceJCheckBox.isSelected() && !piratesJCheckBox.isSelected() ) )
              //display error message
              JOptionPane.showMessageDialog( null, "Please check two boxes", JOptionPane.ERROR_MESSAGE );
         // if lordjcheckbox and pirates is selected = right
         else
              if ( ( lordJCheckBox.isSelected() && piratesJCheckBox.isSelected() ))
                   JOptionPane.showMessageDialog(null, "Thats RIGHT!");
              //if others are selected = wrong
              else
                   if ( (lordJCheckBox.isSelected() && faceJCheckBox.isSelected() ))
                        JOptionPane.showMessageDialog(null, "Thats WRONG");
                   else
                        ( (faceJCheckBox.isSelected() && piratesJCheckBox.isSelected() ))
                             JOptionPane.showMessageDialog(null, "Thats WRONG");
    // set up nest2JButton
              next2JButton = new JButton();
              next2JButton.setBounds( 155, 296, 94, 24 );
              next2JButton.setText( "Next" );
              questiontwoJPanel.add( next2JButton );
    contentPane.add(questiontwoJPanel);
    next2JButton.addActionListener(
         new ActionListener(){
              public void actionPerformed(ActionEvent e){
                   questionthree();
    } // end questiontwo
    public void questionthree()
         //setup questionthree JPanel
         questiontwoJPanel.setVisible(false);
         questionthreeJPanel = new JPanel();
         questionthreeJPanel.setLayout(null);
         questionthreeJPanel.setBounds(0, 0, 600, 400);
         questionthreeJPanel.setBackground( Color.GREEN);
              // main method
              public static void main( String[] args )
              Mindboggler application = new Mindboggler();
              application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              } // end method main
    }// end class
    WOULD BE VERY GEATFUL

    Just want to say thank you by the way for trying to help. Ive moved public void inputJButtonActionPerformed( ActionEvent event ) outside of brackets. Now i have a different problem on it. Sorry about this.
    PROBLEM: --------------------Configuration: <Default>--------------------
    C:\Documents and Settings\Laila\My Documents\CMT2080\Coursework\Game\Mindboggler.java:353: 'else' without 'if'
    else ( ( !lordJCheckBox.isSelected() && !faceJCheckBox.isSelected && !piratesJCheckBox.isSelected() ) )
    ^
    1 error
    Process completed.
    MY CODE:
    //Mind boggler quiz
    //Marcelyn Samson
    import java.awt.*;
    import java.awt.event.*;
    import java.text.DecimalFormat;
    import javax.swing.*;
    import javax.swing.border.*;
    import java.lang.*;
    public class Mindboggler extends JFrame
              // JPanel for welcome window
              private JPanel welcomeJPanel;
              private JPanel presetJPanel;
         private JLabel titleJLabel;
         private JLabel quizJLabel;
         private JLabel girlJLabel, headJLabel;
         private JLabel introJLabel;
         private JButton startJButton;
         // JPanel for questionone window
         private JPanel questiononeJPanel;
         private JLabel textJLabel;
         private JPanel becksJPanel;
         private JButton oneJButton, twoJButton, threeJButton, fourJButton, nextJButton;
              //JPanel for questiontwo window
              private JPanel questiontwoJPanel;
              private JPanel orlandoJPanel;
              private JLabel q2JLabel;
              private JCheckBox lordJCheckBox;
              private JCheckBox faceJCheckBox;
              private JCheckBox piratesJCheckBox;
              private JButton next2JButton;
         private JButton inputJButton;
         //JPanel for questionthree
         private JPanel questionthreeJPanel;
         private JPanel howmuchJPanel;
         private JLabel howmuchJLabel;
         private JLabel nameJLabel;
         private JTextField nameJTextField;
         private JLabel moneyJLabel;
         private JTextField moneyJTextField;
         private JButton next3JButton;
         //Publics
         public JPanel welcomeJFrame, questionJFrame, questiontwoJFrame, questionthreeJFrame;
         //contentPane
              public Container contentPane;
              //no argument constructor
              public Mindboggler()
                   createUserInterface();
              //create and position components
              private void createUserInterface()/////////////////////////; semo colon do not edit copy paste
                   //get contentPane and set layout to null
                   contentPane = getContentPane();
                   contentPane.setLayout ( null );
                   welcome();
                   //set properties of applications window
                   setTitle( "Mindboggler" ); // set JFrame's title bar string
              setSize( 600, 400 ); // set width and height of JFrame
              setVisible( true ); // display JFrame on screen
              } // end method createUserInterface
              public void welcome(){
                        // set up welcomeJPanel
                   welcomeJPanel = new JPanel();
                   welcomeJPanel.setLayout( null );
                   welcomeJPanel.setBounds(0, 0, 600, 400);
                   welcomeJPanel.setBackground( Color.GREEN );
                   // set up textJLabel
                   titleJLabel = new JLabel();
                   titleJLabel.setText( "Mind Boggler" );
                   titleJLabel.setLocation( 30, 10);
                   titleJLabel.setSize( 550, 70);
                   titleJLabel.setFont( new Font( "SansSerif", Font.PLAIN, 30 ) );
                   titleJLabel.setHorizontalAlignment( JLabel.CENTER );
                   welcomeJPanel.add( titleJLabel );
                   // set up presetJPanel
                   presetJPanel = new JPanel();
                   presetJPanel.setLayout( null );
                   presetJPanel.setBounds( 150, 10, 300, 80 );
                   presetJPanel.setBackground( Color.GRAY );
                   welcomeJPanel.add( presetJPanel );
                   //setup Intro JLabel
                   introJLabel = new JLabel();
                   introJLabel.setText( "Think, think, think. Can you get all the questions right?" );
                   introJLabel.setBounds( 40, 100, 500, 200 );
                   introJLabel.setFont( new Font( "SansSerif", Font.PLAIN, 18 ) );
                   introJLabel.setHorizontalAlignment( JLabel.CENTER );
                   welcomeJPanel.add(introJLabel);
                   //set up head JLabel
                   headJLabel = new JLabel();
                   headJLabel.setIcon( new ImageIcon( "head.jpeg") );
                   headJLabel.setBounds( 540, 5, 40, 160 );
                   headJLabel.setHorizontalAlignment( JLabel.CENTER );
                   welcomeJPanel.add(headJLabel);
                        //setup girlJLabel
                   girlJLabel = new JLabel();
                   girlJLabel.setIcon( new ImageIcon( "girl.Jjpeg") );
                   girlJLabel.setBounds( 5, 10, 60, 100 );
                   girlJLabel.setHorizontalAlignment( JLabel.CENTER );
                   welcomeJPanel.add(girlJLabel);
                        //set up startJbutton
                   startJButton = new JButton();
                   startJButton.setText( "Start" );
                   startJButton.setBounds(250, 300, 100, 30);
                   startJButton.setFont( new Font( "SansSerif", Font.BOLD, 14) );
                   welcomeJPanel.add(startJButton);
                   contentPane.add(welcomeJPanel);
                   startJButton.addActionListener(
                        new ActionListener(){
                             public void actionPerformed(ActionEvent e){
                                  question();
              public void question()
                   //set up question one JPanel
                   welcomeJPanel.setVisible(false);
                   questiononeJPanel = new JPanel();
         questiononeJPanel.setLayout( null );
              questiononeJPanel.setBounds(0, 0, 600,400);
              questiononeJPanel.setBackground( Color.GREEN );
              // set up textJLabel
              textJLabel = new JLabel();
              textJLabel.setText( "Who did Beckham supposedly cheat with?" );
              textJLabel.setLocation( 20, 20);
              textJLabel.setSize( 550, 70);
              textJLabel.setFont( new Font( "SansSerif", Font.BOLD, 20 ) );
              textJLabel.setHorizontalAlignment( JLabel.CENTER );
              questiononeJPanel.add( textJLabel );
                   // set up presetJPanel
              becksJPanel = new JPanel();
              becksJPanel.setLayout( null );
              becksJPanel.setBorder( new TitledBorder(
         "Question 1" ) );
              becksJPanel.setBounds( 10, 10, 570, 80 );
              becksJPanel.setBackground( Color.GRAY );
              questiononeJPanel.add( becksJPanel );
                   // set up oneJButton
              oneJButton = new JButton();
              oneJButton.setBounds( 10, 120, 300, 40 );
              oneJButton.setText( "Britney Spears" );
              oneJButton.setBackground( Color.ORANGE );
              questiononeJPanel.add( oneJButton );
              // set up twoJButton
              twoJButton = new JButton();
              twoJButton.setBounds( 10, 180, 300, 40 );
              twoJButton.setText( "Meg Ryan" );
              twoJButton.setBackground( Color.ORANGE );
              questiononeJPanel.add( twoJButton );
              // set up threeJButton
              threeJButton = new JButton();
              threeJButton.setBounds( 10, 240, 300, 40 );
              threeJButton.setText( "Rebecca Loos" );
              threeJButton.setBackground( Color.ORANGE );
              questiononeJPanel.add( threeJButton );
              // set up fourJButton
              fourJButton = new JButton();
              fourJButton.setBounds( 10, 300, 300, 40 );
              fourJButton.setText( "Angelina Jolie" );
              fourJButton.setBackground( Color.ORANGE );
              questiononeJPanel.add( fourJButton );
                   // set up nextJButton
                   nextJButton = new JButton();
                   nextJButton.setBounds ( 375, 300, 150, 40 );
                   nextJButton.setText("Next");
                   nextJButton.setBackground( Color.GRAY );
                   questiononeJPanel.add( nextJButton );
                   contentPane.add(questiononeJPanel);
              nextJButton.addActionListener(
                        new ActionListener(){
                             public void actionPerformed(ActionEvent e){
                                  questiontwo();
              public void questiontwo()
                   //set up question two JPanel
                   questiononeJPanel.setVisible(false);
                   questiontwoJPanel=new JPanel();
                   questiontwoJPanel.setLayout(null);
                   questiontwoJPanel.setBounds(0, 0, 600, 400);
                   questiontwoJPanel.setBackground( Color.GREEN );
                   // set up q2JLabel
              q2JLabel = new JLabel();
              q2JLabel.setBounds( 20, 20, 550, 70 );
              q2JLabel.setText( "What films has Orlando Bloom starred in?" );
              q2JLabel.setFont(new Font( "SansSerif", Font.BOLD, 20 ) );
         q2JLabel.setHorizontalAlignment( JLabel.CENTER );
    questiontwoJPanel.add(q2JLabel);
    //set up orlandoJPanel
    orlandoJPanel = new JPanel();
    orlandoJPanel.setLayout(null);
    orlandoJPanel.setBorder( new TitledBorder("Question 2"));
    orlandoJPanel.setBounds( 10, 10, 570, 80);
    orlandoJPanel.setBackground(Color.GRAY);
    questiontwoJPanel.add(orlandoJPanel);
    // set up lordJCheckBox
              lordJCheckBox = new JCheckBox();
              lordJCheckBox.setBounds( 16, 112, 200, 24 );
              lordJCheckBox.setText( "1. Lord of The Rings" );
              questiontwoJPanel.add( lordJCheckBox );
                   // set up faceJCheckBox
              faceJCheckBox = new JCheckBox();
              faceJCheckBox.setBounds( 16, 159, 200, 24 );
              faceJCheckBox.setText( "2. Face Off" );
              questiontwoJPanel.add( faceJCheckBox );
              // set up piratesJCheckBox
              piratesJCheckBox = new JCheckBox();
              piratesJCheckBox.setBounds( 16, 206, 200, 24 );
              piratesJCheckBox.setText( "3. Pirates of The Caribean" );
              questiontwoJPanel.add( piratesJCheckBox );
              // set up inputJButton
              inputJButton = new JButton();
              inputJButton.setBounds(20, 256, 200, 21 );
              inputJButton.setText( "Input answer" );
              questiontwoJPanel.add( inputJButton );
    inputJButton.addActionListener(
         new ActionListener()
              //event handler called when user clicks inputJButton
              public void actionPerformed( ActionEvent event )
                   inputJButtonActionPerformed( event);
    // set up nest2JButton
              next2JButton = new JButton();
              next2JButton.setBounds( 155, 296, 94, 24 );
              next2JButton.setText( "Next" );
              questiontwoJPanel.add( next2JButton );
    contentPane.add(questiontwoJPanel);
    next2JButton.addActionListener(
         new ActionListener(){
              public void actionPerformed(ActionEvent e){
                   questionthree();
    } // end questiontwo
    public void questionthree()
         //setup questionthree JPanel
         questiontwoJPanel.setVisible(false);
         questionthreeJPanel = new JPanel();
         questionthreeJPanel.setLayout(null);
         questionthreeJPanel.setBounds(0, 0, 600, 400);
         questionthreeJPanel.setBackground( Color.GREEN);
         //setup howmuchJLabel
         howmuchJLabel = new JLabel();
         howmuchJLabel.setText("I'm a student and would be very greatful if you could donate some money as it would help me very much.");
         howmuchJLabel.setBounds(20, 20, 550, 70);
         howmuchJLabel.setFont(new Font("SansSerif",Font.BOLD,14));
         howmuchJLabel.setHorizontalAlignment(JLabel.CENTER);
         questionthreeJPanel.add(howmuchJLabel);
         //setup howmuchJPanel
         howmuchJPanel = new JPanel();
         howmuchJPanel.setLayout(null);
         howmuchJPanel.setBorder( new TitledBorder("Question 3"));
         howmuchJPanel.setBounds(10, 10, 570, 80);
         howmuchJPanel.setBackground( Color.GRAY);
         questionthreeJPanel.add(howmuchJPanel);
         //setup nameJLabel
         nameJLabel = new JLabel();
         nameJLabel.setText("Name");
         nameJLabel.setBounds(10, 160, 150, 24);
         nameJLabel.setFont(new Font("SansSerif",Font.BOLD,12));
         questionthreeJPanel.add(nameJLabel);
         //setup nameJTextField
         nameJTextField = new JTextField();
         nameJTextField.setBounds(125, 160, 200, 24 );
         questionthreeJPanel.add(nameJTextField);
         contentPane.add(questionthreeJPanel);
         //show JOptionMessages when user clicks on JCheckBoxes and inputJButton
    public void inputJButtonActionPerformed( ActionEvent event )
         //display error message if no JCheckBoxes is checked
         else ( ( !lordJCheckBox.isSelected() && !faceJCheckBox.isSelected && !piratesJCheckBox.isSelected() ) )
              //display error message
              JOptionPane.showMessageDialog( null, "Please check two boxes", JOptionPane.ERROR_MESSAGE );
         // if lordjcheckbox and pirates is selected = right
         else
              if ( ( lordJCheckBox.isSelected() && piratesJCheckBox.isSelected() ))
                   JOptionPane.showMessageDialog(null, "Thats RIGHT!");
              //if others are selected = wrong
              else
                   if ( (lordJCheckBox.isSelected() && faceJCheckBox.isSelected() ))
                        JOptionPane.showMessageDialog(null, "Thats WRONG");
                   else
                        ( (faceJCheckBox.isSelected() && piratesJCheckBox.isSelected() ))
                             JOptionPane.showMessageDialog(null, "Thats WRONG");
              // main method
              public static void main( String[] args )
              Mindboggler application = new Mindboggler();
              application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              } // end method main
    }// end class

  • Problem with DNS - ping/Safari cannot resolve, but host/dig work OK

    Hi All,
    Have a weird problem with DNS which is a bit similar to the following ones:
    http://discussions.info.apple.com/thread.jspa?threadID=2190208
    http://forums.macrumors.com/showthread.php?t=337942
    I connect with remote internal network via OpenVPN and from time to time (yes, intermittent problem :)) internal DNS names cannot be resolved.
    When it happens I can still resolve names using host or dig utilities, but applications (like Safari) and ping cannot resolve them.
    resolv.conf has proper DNS server set:
    *$ cat /etc/resolv.conf*
    *# Mac OS X Notice*
    *# This file is not used by the host name and address resolution*
    *# or the DNS query routing mechanisms used by most processes on*
    *# this Mac OS X system.*
    *# This file is automatically generated.*
    *domain openvpn*
    *search openvpn*
    *nameserver 10.0.0.1*
    More than that - it can resolve those internal names when queried directly, for example using host:
    *$ host YYY.XXX.ru 10.0.0.1*
    *Using domain server:*
    *Name: 10.0.0.1*
    *Address: 10.0.0.1#53*
    Aliases:
    *YYY.XXX.ru has address 192.168.x.y*
    but at the same time ping reports "*Unknown host*":
    *$ ping YYY.XXX.ru*
    *ping: cannot resolve YYY.XXX.ru: Unknown host*
    I tried "*dscacheutil -flushcache*" and it did not help. Also tried to comment out domain and search directives in resolv.conf and it did not help as well (and actually it should not matter).
    Any ideas why this can happen and what else can I check when it happens again?
    Thanks!

    I have the same issue. It cropped up after I installed updates to MS Office 2008 and Firefox in which I also saw issues with the icons disappearing in the dock of the applications that were open when I started the Office update. I rebooted to try to get them back, but ended up deleting them and restoring from the Applications folder. I don't know if that's a red herring or not, but I generally try to figure out what has recently changed that may cause something to suddenly start failing.
    I'd been working successfully all morning before it started acting up. Switching from wifi to cat5 had no effect.
    @realaaa, were you able to resolve without a major undertaking, like reinstalling your OS?
    pnmbp:~ pn$ dig goo.gl
    ; <<>> DiG 9.6.0-APPLE-P2 <<>> goo.gl
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40996
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 0
    ;; QUESTION SECTION:
    ;goo.gl. IN A
    ;; ANSWER SECTION:
    goo.gl. 140 IN A 74.125.45.139
    goo.gl. 140 IN A 74.125.45.102
    goo.gl. 140 IN A 74.125.45.113
    goo.gl. 140 IN A 74.125.45.138
    goo.gl. 140 IN A 74.125.45.101
    goo.gl. 140 IN A 74.125.45.100
    ;; Query time: 27 msec
    ;; SERVER: 192.168.2.1#53(192.168.2.1)
    ;; WHEN: Mon Dec 13 16:59:34 2010
    ;; MSG SIZE rcvd: 120
    pnmbp:~ pn$ ping goo.gl
    ping: cannot resolve goo.gl: Unknown host
    pnmbp:~ pn$ curl <a class="jive-link-external-small" href="http://">http://goo.gl
    curl: (6) Couldn't resolve host 'goo.gl'
    pnmbp:~ pn$ host goo.gl
    goo.gl has address 74.125.45.100
    goo.gl has address 74.125.45.101
    goo.gl has address 74.125.45.138
    goo.gl has address 74.125.45.113
    goo.gl has address 74.125.45.102
    goo.gl has address 74.125.45.139
    pnmbp:~ pn$

  • Visual Studio 2012 cannot resolve symbol or Errors control is not a member of class

    Visual Studio 2012 Web Site Project (Note not a Web application, so there are not Designer.vb files) > Site works perfectly fine and using IIS and attaching to IIS to debug code.
    However, if I try to build the site inside of Visual Studio I am getting lots of Errors ‘pnlName’ is not a member of ‘Page_Name’ In the code behind I am getting errors ‘Cannot resolve symbol ‘pnlName’
    .ascx Page
    <li style="margin-right:0;" id="pnlName" runat="server"><a href="/cart" title="Checkout" class="global-checkout">Checkout</a></li>
    .ascx.vb page
    Me.pnlName.Attributes.Remove("style")
    I have cleaned, rebuild and nothing gets rid of these errors, but again the site works as designed, but I would like to launch and debug inside of Visual Studio.
    Moojjoo MCP, MCTS
    MCP Virtual Business Card
    http://moojjoo.blogspot.com

    Cor,
    What I am stating is this is a solution using the Web Site Project instead of a
    Web Application Project.
    Web Site projects do not require Designer.vb files, Web Application Projects add Designer.vb files in the solution.   
    Background: I have been hired to support a very successful e-commerce site that was built by a 3rd party vendor (I had no input on the contract or specification, because I would have went with
    MVC).  The site works 100% correctly, however from my 2003 - 2015 experience with Visual Studio and Web Development being in Web Forms and MVC I have always built ASP.NET Solutions using the Web Application Project Templates, which compiles the code down
    to .dlls.  
    A Web Site project does not compile the code, but simply uses the .vb files and they have to be migrated to the server with the .aspx files. http://msdn.microsoft.com/en-us/library/dd547590%28v=vs.110%29.aspx
    Currently the only way I can debug this Solution is to attach to the w3wp.exe process running locally on my work station. 
    The Solution is comprised of two Web Sites, which I cannot get it to compile because of the following errors -
     'webServerControlName' is not a member of '(Protected Code Behind Class Name)'  I am reaching out to the MSDN community to see if anyone has experienced this issue with
    Web Site Projects.
    I hope that clears up the Project Type question.
    Moojjoo MCP, MCTS
    MCP Virtual Business Card
    http://moojjoo.blogspot.com

  • Invoking a web service - cannot resolve method parameter

    I am getting a failure trying to invoking a method called sl_Access on a web service.
    (Same code worked in Workshop 7.1, but fails in Workshop 8.0. The WDSL has not
    changed.) WLW is not able to revolve a method parameter called piCustNo. The service
    call works in WLW 7.1, but not 8.0.
    Any insight on how to fix this problem?
    The service call
    private AnonType_sl_AccessResponse response = null;
    nlastid = response.piLastId;
    the service definition from wsdlControl.jcx ----
    * @jc:protocol form-post="false" form-get="false" http-soap="true"
    public AnonType_sl_AccessResponse sl_Access (int piCustno);
    console error output -----
    Submitted at Wednesday, October 8, 2003 2:15:22 PM EDT
    Exception in sl_Access
    com.bea.control.ServiceControlException:
    SOAP-ENV:Client
    An error was detected in the Web Service request. (10894)
    Cannot resolve method sl_Access parameter ns:piCustno (10933)e91a6247e9b693c3:-1b6d127:f811fed2db:-8000#17
    at com.bea.wlw.runtime.core.control.ServiceControlImpl.invoke(ServiceControlImpl.jcs:846)
    at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:359)
    at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:420)
    at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:393)
    at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke(JcsProxy.java:387)
    at $Proxy11.sl_Access(Unknown Source)
    at com.ovid.service.AccessService.getRepl(AccessService.java:93)
    at com.ovid.service.AccessService.processBatch(AccessService.java:71)
    at Controller.runAccess(Controller.jws:399)

    see:
    http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.workshop&item=1730
    Joe Smith wrote:
    >
    I am getting a failure trying to invoking a method called sl_Access on a web service.
    (Same code worked in Workshop 7.1, but fails in Workshop 8.0. The WDSL has not
    changed.) WLW is not able to revolve a method parameter called piCustNo. The service
    call works in WLW 7.1, but not 8.0.
    Any insight on how to fix this problem?
    The service call
    private AnonType_sl_AccessResponse response = null;
    nlastid = response.piLastId;
    the service definition from wsdlControl.jcx ----
    * @jc:protocol form-post="false" form-get="false" http-soap="true"
    public AnonType_sl_AccessResponse sl_Access (int piCustno);
    console error output -----
    Submitted at Wednesday, October 8, 2003 2:15:22 PM EDT
    Exception in sl_Access
    com.bea.control.ServiceControlException:
    SOAP-ENV:Client
    An error was detected in the Web Service request. (10894)
    Cannot resolve method sl_Access parameter ns:piCustno (10933)e91a6247e9b693c3:-1b6d127:f811fed2db:-8000#17
    at com.bea.wlw.runtime.core.control.ServiceControlImpl.invoke(ServiceControlImpl.jcs:846)
    at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:359)
    at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:420)
    at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:393)
    at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke(JcsProxy.java:387)
    at $Proxy11.sl_Access(Unknown Source)
    at com.ovid.service.AccessService.getRepl(AccessService.java:93)
    at com.ovid.service.AccessService.processBatch(AccessService.java:71)
    at Controller.runAccess(Controller.jws:399)

  • Getting error message Cannot Resolve Symbol when trying to compile a class

    Hello All -
    I am getting an error message cannot resolve symbol while trying to compile a java class that calls another java class in the same package. The called class compiles fine, but the calling class generates
    the following error message:
    D:\Apache Tomcat 4.0\webapps\examples\WEB-INF\classes\cal>javac
    ConnectionPool.java
    ConnectionPool.java:158: cannot resolve symbol
    symbol : class PooledConnection
    location: class cal.ConnectionPool
    private void addConnection(PooledConnection value) {
    ^
    ConnectionPool.java:144: cannot resolve symbol
    symbol : class PooledConnection
    location: class cal.ConnectionPool
    PooledConnection pcon = new PooledConnection(con);
    ^
    ConnectionPool.java:144: cannot resolve symbol
    symbol : class PooledConnection
    location: class cal.ConnectionPool
    PooledConnection pcon = new PooledConnection(con);
    The code is listed as follows for PooledConnection.java (it compiles fine)
    package cal;
    import java.sql.*;
    public class PooledConnection {
    // Real JDBC Connection
    private Connection connection = null;
    // boolean flag used to determine if connection is in use
    private boolean inuse = false;
    // Constructor that takes the passed in JDBC Connection
    // and stores it in the connection attribute.
    public PooledConnection(Connection value) {
    if ( value != null ) {
    connection = value;
    // Returns a reference to the JDBC Connection
    public Connection getConnection() {
    // get the JDBC Connection
    return connection;
    // Set the status of the PooledConnection.
    public void setInUse(boolean value) {
    inuse = value;
    // Returns the current status of the PooledConnection.
    public boolean inUse() {
    return inuse;
    // Close the real JDBC Connection
    public void close() {
    try {
    connection.close();
    catch (SQLException sqle) {
    System.err.println(sqle.getMessage());
    Now the code for ConnectionPool.java class that gives the cannot
    resolve symbol error
    package cal;
    import java.sql.*;
    import java.util.*;
    public class ConnectionPool {
    // JDBC Driver Name
    private String driver = null;
    // URL of database
    private String url = null;
    // Initial number of connections.
    private int size = 0;
    // Username
    private String username = new String("");
    // Password
    private String password = new String("");
    // Vector of JDBC Connections
    private Vector pool = null;
    public ConnectionPool() {
    // Set the value of the JDBC Driver
    public void setDriver(String value) {
    if ( value != null ) {
    driver = value;
    // Get the value of the JDBC Driver
    public String getDriver() {
    return driver;
    // Set the URL Pointing to the Datasource
    public void setURL(String value ) {
    if ( value != null ) {
    url = value;
    // Get the URL Pointing to the Datasource
    public String getURL() {
    return url;
    // Set the initial number of connections
    public void setSize(int value) {
    if ( value > 1 ) {
    size = value;
    // Get the initial number of connections
    public int getSize() {
    return size;
    // Set the username
    public void setUsername(String value) {
    if ( value != null ) {
    username = value;
    // Get the username
    public String getUserName() {
    return username;
    // Set the password
    public void setPassword(String value) {
    if ( value != null ) {
    password = value;
    // Get the password
    public String getPassword() {
    return password;
    // Creates and returns a connection
    private Connection createConnection() throws Exception {
    Connection con = null;
    // Create a Connection
    con = DriverManager.getConnection(url,
    username, password);
    return con;
    // Initialize the pool
    public synchronized void initializePool() throws Exception {
    // Check our initial values
    if ( driver == null ) {
    throw new Exception("No Driver Name Specified!");
    if ( url == null ) {
    throw new Exception("No URL Specified!");
    if ( size < 1 ) {
    throw new Exception("Pool size is less than 1!");
    // Create the Connections
    try {
    // Load the Driver class file
    Class.forName(driver);
    // Create Connections based on the size member
    for ( int x = 0; x < size; x++ ) {
    Connection con = createConnection();
    if ( con != null ) {
    // Create a PooledConnection to encapsulate the
    // real JDBC Connection
    PooledConnection pcon = new PooledConnection(con);
    // Add the Connection to the pool.
    addConnection(pcon);
    catch (Exception e) {
    System.err.println(e.getMessage());
    throw new Exception(e.getMessage());
    // Adds the PooledConnection to the pool
    private void addConnection(PooledConnection value) {
    // If the pool is null, create a new vector
    // with the initial size of "size"
    if ( pool == null ) {
    pool = new Vector(size);
    // Add the PooledConnection Object to the vector
    pool.addElement(value);
    public synchronized void releaseConnection(Connection con) {
    // find the PooledConnection Object
    for ( int x = 0; x < pool.size(); x++ ) {
    PooledConnection pcon =
    (PooledConnection)pool.elementAt(x);
    // Check for correct Connection
    if ( pcon.getConnection() == con ) {
    System.err.println("Releasing Connection " + x);
    // Set its inuse attribute to false, which
    // releases it for use
    pcon.setInUse(false);
    break;
    // Find an available connection
    public synchronized Connection getConnection()
    throws Exception {
    PooledConnection pcon = null;
    // find a connection not in use
    for ( int x = 0; x < pool.size(); x++ ) {
    pcon = (PooledConnection)pool.elementAt(x);
    // Check to see if the Connection is in use
    if ( pcon.inUse() == false ) {
    // Mark it as in use
    pcon.setInUse(true);
    // return the JDBC Connection stored in the
    // PooledConnection object
    return pcon.getConnection();
    // Could not find a free connection,
    // create and add a new one
    try {
    // Create a new JDBC Connection
    Connection con = createConnection();
    // Create a new PooledConnection, passing it the JDBC
    // Connection
    pcon = new PooledConnection(con);
    // Mark the connection as in use
    pcon.setInUse(true);
    // Add the new PooledConnection object to the pool
    pool.addElement(pcon);
    catch (Exception e) {
    System.err.println(e.getMessage());
    throw new Exception(e.getMessage());
    // return the new Connection
    return pcon.getConnection();
    // When shutting down the pool, you need to first empty it.
    public synchronized void emptyPool() {
    // Iterate over the entire pool closing the
    // JDBC Connections.
    for ( int x = 0; x < pool.size(); x++ ) {
    System.err.println("Closing JDBC Connection " + x);
    PooledConnection pcon =
    (PooledConnection)pool.elementAt(x);
    // If the PooledConnection is not in use, close it
    if ( pcon.inUse() == false ) {
    pcon.close();
    else {
    // If it is still in use, sleep for 30 seconds and
    // force close.
    try {
    java.lang.Thread.sleep(30000);
    pcon.close();
    catch (InterruptedException ie) {
    System.err.println(ie.getMessage());
    I am using Sun JDK Version 1.3.0_02" and Apache/Tomcat 4.0. Both the calling and the called class are in the same directory.
    Any help would be greatly appreciated.
    tnx..
    addi

    Is ConnectionPool in this "cal" package as well as PooledConnection? From the directory you are compiling from it appears that it is. If it is, then you are compiling it incorrectly. To compile ConnectionPool (and PooledConnection similarly), you must change the current directory to the one that contains cal and type
    javac cal/ConnectionPool.

  • Songs cannot be copied because they cannot be played on this ipod

    I'm trying to put my new styx cds on my ipod that I got for Christmas but when I try to drag them and put them on my ipod it says 'These songs cannot be copied because they cannot be played on this type of Ipod.' I've imported the CD and all that but it still says this.. HELP! PLEASE!

    Sounds like the songs are in a format the iPod does not recognize. If you have these songs already imported on iTunes, select all of the songs (in this case the Styx songs) then from advanced menu in iTunes select convert selection to ACC, now once iTunes is done converting, re-sync the tunes back up to your iPod, and see if they are recognized.
    Regards--- jgurbisz
    If I helped... please mark as helpful or solved. Thanks

  • Missing method body and cannot resolve symbol

    I keep getting these two errors when trying to compile. I know that I need to call my fibonacci and factorial functions from the main function. Is this why I am getting the missing method body error? How do I correct this?
    Am I getting the cannot resolve symbol because I have to set the num and fact to equal something?
    Thanks
    public class Firstassignment
    public static void main(String[]args)
         System.out.println();
    public static void fibonacci(String[]args);
         int even=1;
         int odd=1;
         while (odd<=100);
         System.out.println(even);
         int temp = even;
         even = odd;
         odd = odd + temp;
    public static void factorial (String[]args);
         for (int count=1;
         count<=num;
         count++);
         fact = fact * count;
         outputbox.printLine("Factorial of" + num + "is" + fact);

    Hey... :o)
    the problem is that you've put semicolons at the end of the function signature, like this:
    public static void fibonacci(String[]args);
    }that should happen only when the function is abstract... so ur function should actually look like this:
    public static void fibonacci(String[]args)
    }also, i think you've missed out on the declarations (like what are fact and num??)....

  • Compc: cannot resolve mx:Object to a component implementation

    Hi,
    I need to migrate a component library to Flex 3.0 but i am
    running into problems with one simple component when trying to
    build the swc by the compc command line tool from within an ant
    script. In FB3.0 the library is created as expected without any
    errors. So here is my component:
    quote:
    <mx:ApplicationToolbar xmlns:mx="
    http://www.adobe.com/2006/mxml".....>
    <mx:Object id="xyz">
    </mx:Object>
    </mx:ApplicationToolbar>
    Using flex 3.0 compc I get the mentioned error:
    "cannot resolve <mx:Object id="xyz" to a component
    implementation"
    What is wrong? Why the compiler does not complain when using
    FB 3.0 ?
    (Compiling with flex 2.0.1 compc works fine too)
    Hope someone can help me.
    Thanks in advance,
    Andreas.

    Hi,
    Object is a top-level class, so i do not have to import it.
    Fortunataly, I found the solution. I had to include the
    following into my ant build script:
    quote:
    <compc ...>
    <load-config
    filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
    </compc>
    Now the library is compiled as expected!

Maybe you are looking for

  • How to generate a report direct in PDF with oracle developer 6i

    hi all Please help me about this issue. THAT How to generate a report directly in PDF using oracle developer 6i. Regards Yousuf Ahmed Siddiqui

  • Oracle 8.1.7 on RedHat 7.2

    Has anyone been able to successfully install 8.1.7 on RedHat 7.2?? If so, can you give some advice, I keep getting make file errors at the end of the install process. Should I give up on 8i and move to 9i?? TIA, David Fordham

  • Disabling selected Purchase Order field(s) after released/approved

    Hi Experts, I have a requirement to disable specific Purchase Order fields after released via ME29N. For example, in Purchase Requisition - I can "Release Indicator - Field Selection Key" to control Purchase Requisition screen layout. However, for Pu

  • Apple Texas Hold 'em glitches in IOS 8

    I know this app has been "discontinued" for a while.  Sad because it is a good single player version. One of my favorite time wasters. I had played it to the point where I had won $67 million. Then I upgraded to IOS 8. First I lost all my money and h

  • Ipad and itunes smart playlists

    Hello I made a smart playlist which includes all podcasts with a certain word in the title like "News". I also have another smart playlist which includes all items from the first playlist, with an added criterion of never having been played before, a