Results 1 to 2 of 2
  1. #1
    Join Date
    May 2011
    Posts
    1
    Rep Power
    0

    Default Internal error-- Cannot Instantiate Font Class??

    I am doing a beginning tutorial working with fonts and i have used the graphics, canvas, and label classes and have had no issues with it. Here's the code and error messages that the compiler is sending back to me.

    Font.java:15: cannot find symbol
    symbol : variable PLAIN
    location: class FontText
    font = new Font("Arial",Font,PLAIN,12);

    FontText.java:15: internal error; cannot instantiate java.awt.Font(init) at java.awt.Font to ()
    font = new Font("Arial",Font,PLAIN,12);


    Does this mean that my system cant pick up the font class?

    I can post my whole code if necessary but these are the only two errors i am receiving.


    anyways, please help

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

    Default

    Quote Originally Posted by MatthewC.Dowell View Post
    Java Code:
    Font.java:15: cannot find symbol
    symbol : variable PLAIN
    location: class FontText
             font = new Font("Arial",Font,PLAIN,12);
    
    FontText.java:15: internal error; cannot instantiate java.awt.Font(init) at java.awt.Font to ()
              font = new Font("Arial",Font,PLAIN,12);
    Does this mean that my system cant pick up the font class?
    Hardly. It means you've got a typographical error in your code. It's not Font,PLAIN but Font.PLAIN.

Similar Threads

  1. How to instantiate Class, into jsp, java script
    By silvia in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 01-04-2014, 08:08 AM
  2. help instantiate a java class that extend applet
    By geosa in forum Java Applets
    Replies: 0
    Last Post: 12-04-2010, 09:14 AM
  3. [SOLVED] Unable to instantiate class?
    By xcallmejudasx in forum New To Java
    Replies: 1
    Last Post: 11-03-2008, 04:03 PM
  4. Replies: 2
    Last Post: 07-04-2007, 03:47 AM
  5. Replies: 0
    Last Post: 06-23-2007, 09:57 PM

Posting Permissions

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