Java Swing: JLabel´s Text / Font shown incompletely

65 views Asked by At

I want to show some kind of information in a JTreeTable and start off with a JDialog, where something is written in JLabels (i think, that's the more unimportant fact).

The problem is, that my JLabel is not shown correctly, there are missing some details (see picture).

enter image description here

I already tried out three kinds of solution:

1.) Working with Runnable,.setLookAndFeel, and .invokeLater:

public NoDataWarningView() {
    Runnable gui = new Runnable() {

        public void run() {
            try {
                UIManager.setLookAndFeel(UIManager
                        .getSystemLookAndFeelClassName());
            } catch (Exception e) {
                e.printStackTrace();
            }
            JOptionPane.showMessageDialog(null,
                    "Some kind of text or information.",
                    "Warning",                        
                        JOptionPane.WARNING_MESSAGE);

        }
    };
    SwingUtilities.invokeLater(gui);
}

2.) Renew the font, before the text is written. It works, but the "OK!" from the button is still missing. Referenced Question

public static void setUIFont (javax.swing.plaf.FontUIResource f){
    java.util.Enumeration keys = UIManager.getDefaults().keys();
    while (keys.hasMoreElements()) {
      Object key = keys.nextElement();
      Object value = UIManager.get (key);
      if (value != null && value instanceof javax.swing.plaf.FontUIResource)
        UIManager.put (key, f);
      }
} 
  1. Deleted a Font-File, because it seems, Java-Fonts were corrupt with Windows-Fonts and restarted. Had no effect. Referenced Question

To rebuild the cache: as administrator, delete this file and reboot the PC:

del %WINDIR%\System32\FNTCACHE.DAT

Somebody has a clue concerning the solution?

0

There are 0 answers