Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

UIManager.put question

 
Matthew Buska
Greenhorn
Posts: 11
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, as you can see I have a Java program that runs.



And according to the book I'm reading, the author says he was able to include this additional code without any problems. Well I'm not sure exactly what he did to get it to compile. I have tried adding several things, but I keep getting the following errors:

Exception in thread "main" java.lang.Error: Unresolved compilation problems:
UIManager cannot be resolved
Font cannot be resolved to a type
Font cannot be resolved to a variable
Syntax error, insert ";" to complete Statement

at Authenticator.main(Authenticator.java:10)


Any help would be greatly appreciated.
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apparently you didn't continue with the step where you import the UIManager class from whatever package it belongs to. Likewise the Font class.
 
Matthew Buska
Greenhorn
Posts: 11
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:Apparently you didn't continue with the step where you import the UIManager class from whatever package it belongs to. Likewise the Font class.


Thank you Paul. You have saved me from having a stroke. I was getting tired of trying to figure out what I was doing wrong. Can I ask you another question if you don't mind.

How do you know when you need to add a important declaration (hope I am saying it right)??? Do you have to import all classes?
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to import all classes which you use, except those in the java.lang package which are automatically imported.

(If you don't import a class, you do have the option of spelling out its full name. Like "javax.swing.JFrame" instead of just "JFrame", for example.)
 
Matthew Buska
Greenhorn
Posts: 11
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like trying to learn this language is going to be fun then. Thanks for your help again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic