Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-1222112

getFont() seems to always return null

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Not an Issue
    • Affects Version/s: 1.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Subcomponent:
    • CPU:
      sparc
    • OS:
      generic

      Description

      I'm trying to slightly enlarge the default font, whatever it is.
      This is quite possibly bogus, but anyway....

      No matter where I do a getFont(), it returns null. I've tried
      it in the init(), start(), and main() methods of my application
      (which theoretically could also run as an applet).

      public class GUI extends Applet { . . .
          public static void main(String args[]) {
              Frame f = new Frame("GUI");
              GUI gui = new GUI();
              gui.init();
              gui.start();
       
              Font oldFont = gui.getFont();
              if (oldFont == null) {
                  System.out.println("Eek! font is null!");
              } else {
                  gui.setFont(new Font(oldFont.getFamily(), oldFont.getStyle(),
                              oldFont.getSize()+2));
              }
       . . .

        Attachments

          Activity

            People

            • Assignee:
              sshaiosunw Sami Shaio (Inactive)
              Reporter:
              kwalrathsunw Kathy Walrath (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: