1. /*
  2. * @(#)WindowsDesktopPaneUI.java 1.20 03/02/03
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.java.swing.plaf.windows;
  8. import javax.swing.*;
  9. import javax.swing.plaf.basic.*;
  10. import javax.swing.plaf.ComponentUI;
  11. import java.awt.event.*;
  12. /**
  13. * Windows desktop pane.
  14. * <p>
  15. * <strong>Warning:</strong>
  16. * Serialized objects of this class will not be compatible with
  17. * future Swing releases. The current serialization support is appropriate
  18. * for short term storage or RMI between applications running the same
  19. * version of Swing. A future release of Swing will provide support for
  20. * long term persistence.
  21. *
  22. * @version %i% 02/03/03
  23. * @author David Kloba
  24. */
  25. public class WindowsDesktopPaneUI extends BasicDesktopPaneUI
  26. {
  27. public static ComponentUI createUI(JComponent c) {
  28. return new WindowsDesktopPaneUI();
  29. }
  30. protected void installDesktopManager() {
  31. if(desktop.getDesktopManager() == null) {
  32. desktopManager = new WindowsDesktopManager();
  33. desktop.setDesktopManager(desktopManager);
  34. }
  35. }
  36. protected void installDefaults() {
  37. super.installDefaults();
  38. }
  39. protected void installKeyboardActions() {
  40. super.installKeyboardActions();
  41. // Request focus if it isn't set.
  42. if(!desktop.requestDefaultFocus()) {
  43. desktop.requestFocus();
  44. }
  45. }
  46. }