DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2006
    Posts
    2

    problem with drawString

    i am creating a java application in eclipse. the java framework i'm using is 1.4.2 and the version of eclipse is 3.1.2.

    the issue i'm having is with drawString. when i attempt to call drawString on a Graphics or Graphics2D object i get the error...

    -------------------------------------------------
    *** glibc detected *** free(): invalid pointer: 0x08089250 ***
    -------------------------------------------------

    here is a sample bit of code that produces the error:

    -------------------------------------------------
    BufferedImage img = new BufferedImage( 100, 100, BufferedImage.TYPE_INT_RGB );
    Graphics g = img.getGraphics();
    g.drawString( "test", 0, 0 );
    -------------------------------------------------

    i, however, do not get any error when i call drawString on the Graphics object in the overriden "paint" method of a JFrame object. for example, the following code works fine:

    -------------------------------------------------
    public void paint( Graphics g )
    {
    g.drawString( "test", 20, 40 );
    }
    -------------------------------------------------

    if someone could please help me out, i'd greatly appreciate it! i'm new to java and this problem has kept me stumped for many hours.

    thanks,
    mike

  2. #2
    Join Date
    Aug 2003
    Posts
    313
    This doesn't seem like a Java problem, but rather a problem with the JVM. What version of the JVM are you using?
    ~evlich

  3. #3
    Join Date
    Jun 2006
    Posts
    2

    Talking thanks!

    i switched to a different version of the jvm and it works!

    thank you so much!

    mike

Similar Threads

  1. Problem with Search
    By Irina in forum ASP.NET
    Replies: 0
    Last Post: 11-29-2002, 10:47 PM
  2. Replies: 0
    Last Post: 12-13-2001, 12:06 PM
  3. a problem with font and language
    By Roseta in forum VB Classic
    Replies: 0
    Last Post: 11-14-2001, 03:24 AM
  4. Arabic problem view
    By Ayman in forum VB Classic
    Replies: 0
    Last Post: 04-03-2000, 01:08 AM
  5. Problem with CryptoAPI and JCE
    By Jason Bock in forum VB Classic
    Replies: 0
    Last Post: 03-21-2000, 06:48 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links