Owl Teach Yourself Java 2 in 21 Days, Second Edition
HOME / ORDER THE BOOK / OTHER BOOKS / THANKS / PREVIOUS DAY / NEXT DAY

Day 8: Working with Swing

Notes and Corrections

  • Page 211: In the example that demonstrates how label components are used, the chance label is not set up correctly. A new example program, Labels.java, creates three labels using the following statements:
    • JLabel tinker = new JLabel("Tinker", SwingConstants.LEFT);
    • JLabel evers = new JLabel("Evers", SwingConstants.CENTER);
    • JLabel chance = new JLabel("Chance", SwingConstants.RIGHT);

Source Files

Reader Questions

  • Question: The SimpleFrame application compiles successfully, but when I try to run it (or any other Swing application), I get this error: "java.lang.UnsatisfiedLinkError: no fontmanager in java.library.path." What's the problem?
    Answer: I can't reproduce this error myself, but after looking through Sun's Java bug database and support forums, it appears to be a problem with font support on your computer.
         On a Windows system, the Java font manager is in a file called fontmanager.dll. To see all the folders in your library path, call System.getProperty("java.library.path") in a Java application and display the string that it returns. (I've written a short application that does this: download SeeLibraryPath.java and SeeLibraryPath.class) Check to see if fontmanager.dll is in one of the folders in the library path. If it isn't, you need to remove and reinstall the Java 2 SDK and the Java 2 runtime.
         If fontmanager.dll is in the right place, you might want to check this JBuilder tech support tip for a fontmanager problem. It advises that you should remove each shortcut from your \Windows\Fonts or \Winnt\Fonts folder and replace it with the actual font the shortcut refers to.

Activities

HOME / ORDER THE BOOK / OTHER BOOKS / THANKS / PREVIOUS DAY / NEXT DAY

Workbench | Books | RSS Feed | RSS Spec | Copyright 2024 World Readable