Results 1 to 2 of 2
  1. #1
    km0r3 is offline Member
    Join Date
    Aug 2010
    Posts
    5
    Rep Power
    0

    Default Method Graphics.drawString() - Symbol not found

    Hey,

    I'm a relative new Java developer, but have previous programming experiences with C++ and mostly Python. I enjoy working with Java, but the last days the following issue has been bothering me:

    When I compile the java.awt.Graphics.drawString() method, in a program, I get the following traceback:

    Java Code:
    Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: Uncompilable source code
            at numerosaleatorios.GameCanvas.paint(GameCanvas.java:43)
            at sun.awt.RepaintArea.paintComponent(RepaintArea.java:264)
            at sun.awt.X11.XRepaintArea.paintComponent(XRepaintArea.java:73)
            at sun.awt.RepaintArea.paint(RepaintArea.java:240)
            at sun.awt.X11.XComponentPeer.handleEvent(XComponentPeer.java:709)
            at java.awt.Component.dispatchEventImpl(Component.java:4545)
            at java.awt.Component.dispatchEvent(Component.java:4295)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:604)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
    Also, I am using NetBeans as my Development environment, and the code get's highlighted in red. Here is a screenshot:



    What I have done to debug the code:
    • I have compared a lot my code with other code on the web, and my code seems to be syntactically correct.
    • I have tried to compile the code outside of NetBeans getting the exact same traceback.


    System specification:
    Product Version: NetBeans IDE 6.8 (Build 100326-unknown-revn)
    Java: 1.6.0_18; OpenJDK 64-Bit Server VM 16.0-b13
    System: Linux version 2.6.32-24-generic running on amd64; UTF-8; en_US (nb) Ubuntu Linux 10.04

    Do you know what I can do to get this fixed?

  2. #2
    km0r3 is offline Member
    Join Date
    Aug 2010
    Posts
    5
    Rep Power
    0

    Default

    I have consulted a friend and we corrected the issue.

    The code looks like this:



    I gave the drawString() method two doubles. Maybe the error message was confusing.

    :wq

Similar Threads

  1. java graphics within main method
    By jforce93 in forum New To Java
    Replies: 4
    Last Post: 02-02-2010, 10:33 PM
  2. JButtonGroup; add() method not found?
    By Moddy in forum AWT / Swing
    Replies: 3
    Last Post: 10-15-2008, 11:08 PM
  3. Compile: symbol not found
    By zuan in forum New To Java
    Replies: 7
    Last Post: 06-24-2008, 05:17 AM
  4. symbol not found error
    By rmartyce in forum New To Java
    Replies: 1
    Last Post: 05-23-2008, 05:58 AM
  5. Replies: 3
    Last Post: 05-01-2008, 08:30 AM

Tags for this Thread

Posting Permissions

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