[Jarspy-commits] CVS: JarSpy/src/com/ociweb/gui ChangeLookAndFeelAction.java,1.2,1.3
Status: Beta
Brought to you by:
brown_j
|
From: Jeff B. <br...@us...> - 2002-10-17 23:29:08
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/gui
In directory usw-pr-cvs1:/tmp/cvs-serv30556/src/com/ociweb/gui
Modified Files:
ChangeLookAndFeelAction.java
Log Message:
added some Kunststoff support
Index: ChangeLookAndFeelAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/gui/ChangeLookAndFeelAction.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ChangeLookAndFeelAction.java 19 Jun 2002 01:19:10 -0000 1.2
--- ChangeLookAndFeelAction.java 17 Oct 2002 23:29:04 -0000 1.3
***************
*** 19,25 ****
package com.ociweb.gui;
! import javax.swing.*;
! import java.awt.*;
import java.awt.event.ActionEvent;
public class ChangeLookAndFeelAction extends AbstractAction {
--- 19,31 ----
package com.ociweb.gui;
! import java.awt.Component;
import java.awt.event.ActionEvent;
+ import javax.swing.AbstractAction;
+ import javax.swing.LookAndFeel;
+ import javax.swing.SwingUtilities;
+ import javax.swing.UIManager;
+ import javax.swing.UnsupportedLookAndFeelException;
+ import javax.swing.plaf.metal.DefaultMetalTheme;
+ import javax.swing.plaf.metal.MetalLookAndFeel;
public class ChangeLookAndFeelAction extends AbstractAction {
***************
*** 45,48 ****
--- 51,64 ----
try {
UIManager.setLookAndFeel(laf);
+ try {
+ // deal with Kunststoff issue that leaves the static theme
+ // member setup the Kunststoff way even after switching back
+ // to metal
+ if (laf instanceof MetalLookAndFeel) {
+ ((MetalLookAndFeel) laf).setCurrentTheme(new DefaultMetalTheme());
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
if (parentComponent != null) {
SwingUtilities.updateComponentTreeUI(parentComponent);
|