+ FontMetrics fm = getGraphics().getFontMetrics(newFont);
+ double mw = fm.getStringBounds("M", getGraphics()).getWidth(), iw = fm
+ .getStringBounds("I", getGraphics()).getWidth();
+ if (mw < 1 || iw < 1)
+ {
+ fontName.setSelectedItem(lastSelected.getName());
+ fontStyle.setSelectedIndex(lastSelStyle);
+ fontSize.setSelectedItem("" + lastSelSize);
+ monospaced.setSelected(lastSelMono);
+ JOptionPane
+ .showInternalMessageDialog(
+ this,
+ MessageManager.getString("label.font_doesnt_have_letters_defined"),
+ MessageManager.getString("label.invalid_font"), JOptionPane.WARNING_MESSAGE);
+ return;
+ }