private void initializeListeners() {
    // Add the input listeners
    addMouseListener(listener);
    addMouseMotionListener(listener);
    addMouseWheelListener(listener);
    addFocusListener(listener);
    addComponentListener(listener);
    addKeyListener(listener);

    caret.addCaretListener(listener);
  }
In order to get the font metrics, a graphics context is required. This function temporarily
creates one.
java/zylib/src/main/java/com/google/security/zynamics/zylib/gui/CodeDisplay/CodeDisplay.java