Hi!
Ich schreibe derzeit an einer Swing-GUI unter Linux und Eclipse. Dort schaue ich mir das meist mit dem Metal oder GTK+ Look and Feel an. Wenn ich unter Windows jedoch z.B. die JGoodies oder sämtliche Windows/System-LAFs auswähle, bekomme ich eine Exception, die beim System-LAF z.B. so aussieht:
Zugewiesen wird das LAF als erstes nach "super();" im Konstruktor der Fensterklasse:
Die GUI selbst wird gar nicht bzw. nur teilweise gemalt. Stattdessen sind Fragmente von darunterliegenden Komponenten sichtbar, oder es wird alles verwischt.
Woran liegt das Problem und wie bekomme ich es los, so dass ich auch die schönen Windows-LAFs nutzen kann?
Viele Grüße
alias5000
Ich schreibe derzeit an einer Swing-GUI unter Linux und Eclipse. Dort schaue ich mir das meist mit dem Metal oder GTK+ Look and Feel an. Wenn ich unter Windows jedoch z.B. die JGoodies oder sämtliche Windows/System-LAFs auswähle, bekomme ich eine Exception, die beim System-LAF z.B. so aussieht:
Java:
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: javax.swing.DebugGraphics cannot be cast to java.awt.Graphics2D
at com.sun.java.swing.plaf.windows.WindowsTabbedPaneUI.paintRotatedSkin(Unknown Source)
at com.sun.java.swing.plaf.windows.WindowsTabbedPaneUI.paintContentBorder(Unknown Source)
at javax.swing.plaf.basic.BasicTabbedPaneUI.paint(Unknown Source)
at javax.swing.plaf.ComponentUI.update(Unknown Source)
at javax.swing.JComponent.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintToOffscreen(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
at javax.swing.RepaintManager.paint(Unknown Source)
at javax.swing.JComponent._paintImmediately(Unknown Source)
at javax.swing.JComponent.paintImmediately(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Zugewiesen wird das LAF als erstes nach "super();" im Konstruktor der Fensterklasse:
Java:
public MainWindow() {
super();
{
//Set Look & Feel
try {
javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
} catch(Exception e) {
e.printStackTrace();
}
}
initGUI();
}
Die GUI selbst wird gar nicht bzw. nur teilweise gemalt. Stattdessen sind Fragmente von darunterliegenden Komponenten sichtbar, oder es wird alles verwischt.
Woran liegt das Problem und wie bekomme ich es los, so dass ich auch die schönen Windows-LAFs nutzen kann?
Viele Grüße
alias5000