wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes UIManager.put question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "UIManager.put question" Watch "UIManager.put question" New topic
Author

UIManager.put question

Matthew Buska
Greenhorn

Joined: Jul 27, 2004
Posts: 11

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
Bartender

Joined: Oct 14, 2005
Posts: 18672
    
    8

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

Joined: Jul 27, 2004
Posts: 11

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
Bartender

Joined: Oct 14, 2005
Posts: 18672
    
    8

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

Joined: Jul 27, 2004
Posts: 11

Sounds like trying to learn this language is going to be fun then. Thanks for your help again.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: UIManager.put question