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

    Default Method Graphics.drawString() - Symbol not found


    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(
            at sun.awt.RepaintArea.paintComponent(
            at sun.awt.X11.XRepaintArea.paintComponent(
            at sun.awt.RepaintArea.paint(
            at sun.awt.X11.XComponentPeer.handleEvent(
            at java.awt.Component.dispatchEventImpl(
            at java.awt.Component.dispatchEvent(
            at java.awt.EventQueue.dispatchEvent(
            at java.awt.EventDispatchThread.pumpOneEventForFilters(
            at java.awt.EventDispatchThread.pumpEventsForFilter(
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(
            at java.awt.EventDispatchThread.pumpEvents(
            at java.awt.EventDispatchThread.pumpEvents(
    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
    Rep Power


    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.


Similar Threads

  1. java graphics within main method
    By jforce93 in forum New To Java
    Replies: 4
    Last Post: 02-02-2010, 11: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