1. /*
  2. * @(#)WindowsDesktopPaneUI.java 1.23 03/12/19
  3. *
  4. * Copyright 2004 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% 12/19/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. desktopManager = desktop.getDesktopManager();
  32. if(desktopManager == null) {
  33. desktopManager = new WindowsDesktopManager();
  34. desktop.setDesktopManager(desktopManager);
  35. }
  36. }
  37. protected void installDefaults() {
  38. super.installDefaults();
  39. }
  40. protected void installKeyboardActions() {
  41. super.installKeyboardActions();
  42. // Request focus if it isn't set.
  43. if(!desktop.requestDefaultFocus()) {
  44. desktop.requestFocus();
  45. }
  46. }
  47. }