Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2011
    Posts
    4
    Rep Power
    0

    Default Issue compiling Java Code

    Hi,
    I have a .java file containing a class extending JApplet. I have a second .java file containing a class extending JPanel. Both files are located in the directory C:...../files/mods/md/.

    In my JApplet class I try and create an instance of the JPanel class I created but (after I compile the JPanel class) the JApplet class fails to compile. Both classes have the first line as package mods.md;

    Any suggestions what could be causing this problem? There are 2 errors in my JApplet class each point to the JPanel class references (i.e. MDrawing mObject = new MDrawing(); => errors point to MDrawing).

    AF

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    we'll need code and actual error message as well as a comment in the code indicating which lines cause the error messages.

  3. #3
    Join Date
    Jan 2011
    Posts
    4
    Rep Power
    0

    Default

    If I had the class for extending the JApplet and the class extending the JPanel in the same file and compiled it there's no problem. I tried separating the 2 classes into their own .java file and compiling separately and now the JApplet fails when trying to reference the JPanel class. I was hoping someone ran into this before without needing to post code.

  4. #4
    Join Date
    Jan 2011
    Posts
    4
    Rep Power
    0

    Default

    MDrawing compiles fine but this .java doesn't (extends JApplet). It complains about the line trying to create an instance of JPanel extended class.

    mods/geom/mDraw.java:36: cannot find symbol
    symbol : class MDrawing
    location: class mods.geom.mDraw
    MDrawing mImage = new MDrawing(xAxis,yAxis,tmpAxis,lineV
    alues,ptLabs,dispBlock,geoshape,chChar);
    ^
    mods/geom/mDraw.java:36: cannot find symbol
    symbol : class MDrawing
    location: class mods.geom.mDraw
    MDrawing mImage = new MDrawing(xAxis,yAxis,tmpAxis,lineV
    alues,ptLabs,dispBlock,geoshape,chChar);
    ^
    2 errors

  5. #5
    Join Date
    Jan 2011
    Posts
    4
    Rep Power
    0

Similar Threads

  1. Compiling java code from the command line
    By alman9898 in forum New To Java
    Replies: 5
    Last Post: 10-13-2010, 03:35 AM
  2. simple code not compiling
    By cliffh in forum New To Java
    Replies: 8
    Last Post: 09-30-2010, 05:47 AM
  3. my code compiling but not running
    By girishkumar in forum New To Java
    Replies: 16
    Last Post: 03-16-2010, 04:45 PM
  4. Help me out in compiling the source code
    By aks.nitw in forum Advanced Java
    Replies: 3
    Last Post: 10-17-2008, 08:33 AM
  5. Trouble compiling code
    By waelhelbawi in forum New To Java
    Replies: 1
    Last Post: 05-12-2008, 04:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •