--- /home/cpdev/src/classpath/javax/swing/plaf/basic/BasicInternalFrameUI.java	2005-07-13 05:32:59.000000000 +0000
+++ javax/swing/plaf/basic/BasicInternalFrameUI.java	2005-06-30 05:35:18.000000000 +0000
@@ -1,5 +1,5 @@
 /* BasicInternalFrameUI.java --
-   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2004 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -53,10 +53,7 @@
 import java.awt.event.MouseEvent;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
-import java.beans.PropertyVetoException;
-import java.beans.VetoableChangeListener;
 
-import javax.swing.BorderFactory;
 import javax.swing.DefaultDesktopManager;
 import javax.swing.DesktopManager;
 import javax.swing.JComponent;
@@ -65,16 +62,11 @@
 import javax.swing.KeyStroke;
 import javax.swing.SwingConstants;
 import javax.swing.SwingUtilities;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
 import javax.swing.border.AbstractBorder;
-import javax.swing.border.BevelBorder;
-import javax.swing.border.Border;
 import javax.swing.event.InternalFrameEvent;
 import javax.swing.event.InternalFrameListener;
 import javax.swing.event.MouseInputAdapter;
 import javax.swing.event.MouseInputListener;
-import javax.swing.plaf.BorderUIResource;
 import javax.swing.plaf.ComponentUI;
 import javax.swing.plaf.InternalFrameUI;
 import javax.swing.plaf.UIResource;
@@ -170,7 +162,7 @@
     implements SwingConstants
   {
     /** FIXME: Use for something. */
-    protected final int RESIZE_NONE = 0;
+    protected int RESIZE_NONE;
 
     /** The x offset from the top left corner of the JInternalFrame. */
     private transient int xOffset = 0;
@@ -650,9 +642,6 @@
     /** The last component entered. */
     private transient Component lastComponentEntered;
 
-    /** Used to store/reset lastComponentEntered. */
-    private transient Component tempComponent;
-
     /** The number of presses. */
     private transient int pressCount;
 
@@ -773,9 +762,8 @@
 	                                     tp.x, tp.y, me.getClickCount(),
 	                                     me.isPopupTrigger(),
 	                                     me.getButton());
-          tempComponent = lastComponentEntered;
+	  lastComponentEntered.dispatchEvent(exited);
 	  lastComponentEntered = null;
-	  tempComponent.dispatchEvent(exited);
         }
 
       // If we have a candidate, maybe enter it.
@@ -876,32 +864,8 @@
    * JInternalFrame.
    */
   public class InternalFramePropertyChangeListener
-    implements PropertyChangeListener, VetoableChangeListener
+    implements PropertyChangeListener
   {
-
-    /**
-     * This method is called when one of the JInternalFrame's properties
-     * change.  This method is to allow JInternalFrame to veto an attempt
-     * to close the internal frame.  This allows JInternalFrame to honour
-     * its defaultCloseOperation if that is DO_NOTHING_ON_CLOSE.
-     */
-    public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException
-    {
-      if (e.getPropertyName().equals(JInternalFrame.IS_CLOSED_PROPERTY))
-        {
-          if (frame.getDefaultCloseOperation() == JInternalFrame.HIDE_ON_CLOSE)
-            {
-              frame.setVisible(false);
-              frame.getDesktopPane().repaint();
-              throw new PropertyVetoException ("close operation is HIDE_ON_CLOSE\n", e);
-            }
-          else if (frame.getDefaultCloseOperation() == JInternalFrame.DISPOSE_ON_CLOSE)
-            closeFrame(frame);
-          else
-            throw new PropertyVetoException ("close operation is DO_NOTHING_ON_CLOSE\n", e);
-        }
-    }
-    
     /**
      * This method is called when one of the JInternalFrame's properties
      * change.
@@ -917,6 +881,8 @@
 	  else
 	    minimizeFrame(frame);
         }
+      else if (evt.getPropertyName().equals(JInternalFrame.IS_CLOSED_PROPERTY))
+	closeFrame(frame);
       else if (evt.getPropertyName().equals(JInternalFrame.IS_ICON_PROPERTY))
         {
 	  if (frame.isIcon())
@@ -1065,13 +1031,6 @@
    */
   protected PropertyChangeListener propertyChangeListener;
 
-  /**
-   * The VetoableChangeListener.  Listens to PropertyChangeEvents
-   * from the JInternalFrame and allows the JInternalFrame to 
-   * veto attempts to close it.
-   */
-  private VetoableChangeListener internalFrameVetoableChangeListener;
-
   /** The InternalFrameListener that listens to the JInternalFrame. */
   private transient BasicInternalFrameListener internalFrameListener;
 
@@ -1178,31 +1137,9 @@
    * This method installs the defaults specified by the look and feel.
    */
   protected void installDefaults()
-    {
-      // This is the border of InternalFrames in the BasicLookAndFeel.
-      // Note that there exist entries for various border colors in
-      // BasicLookAndFeel's defaults, but obviously they differ
-      // from the colors that are actually used by the JDK.
-      UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-      Color borderColor = defaults.getColor("InternalFrame.borderColor");
-      Border inner = BorderFactory.createLineBorder(borderColor, 1);
-      Color borderDarkShadow = defaults.getColor
-	  ("InternalFrame.borderDarkShadow");
-      Color borderHighlight = defaults.getColor
-	  ("InternalFrame.borderHighlight");
-      Color borderShadow = defaults.getColor("InternalFrame.borderShadow");
-      Color borderLight = defaults.getColor("InternalFrame.borderLight");
-      Border outer = BorderFactory.createBevelBorder(BevelBorder.RAISED,
-						     borderShadow,
-						     borderHighlight,
-						     borderDarkShadow,
-						     borderShadow);
-      Border border = new BorderUIResource.CompoundBorderUIResource(outer,
-								    inner);
-      frame.setBorder(border);
-
-      // InternalFrames are invisible by default.
-      frame.setVisible(false);
+  {
+    // FIXME: Move border to MetalBorders
+    frame.setBorder(new InternalFrameBorder());
   }
 
   /**
@@ -1234,13 +1171,12 @@
     borderListener = createBorderListener(frame);
     componentListener = createComponentListener();
     propertyChangeListener = createPropertyChangeListener();
-    internalFrameVetoableChangeListener = new InternalFramePropertyChangeListener();
 
     frame.addMouseListener(borderListener);
     frame.addMouseMotionListener(borderListener);
     frame.addInternalFrameListener(internalFrameListener);
     frame.addPropertyChangeListener(propertyChangeListener);
-    frame.addVetoableChangeListener(internalFrameVetoableChangeListener);
+
     frame.getRootPane().getGlassPane().addMouseListener(glassPaneDispatcher);
     frame.getRootPane().getGlassPane().addMouseMotionListener(glassPaneDispatcher);
   }
@@ -1616,10 +1552,7 @@
    */
   protected DesktopManager getDesktopManager()
   {
-    DesktopManager value = null;
-    JDesktopPane pane = frame.getDesktopPane();
-    if (pane != null)
-      value = frame.getDesktopPane().getDesktopManager();
+    DesktopManager value = frame.getDesktopPane().getDesktopManager();
     if (value == null)
       value = createDesktopManager();
     return value;
