1. /*
  2. * @(#)BasicPanelUI.java 1.8 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.swing.plaf.basic;
  8. import java.awt.*;
  9. import javax.swing.*;
  10. import javax.swing.border.*;
  11. import javax.swing.plaf.*;
  12. import java.awt.*;
  13. import java.awt.event.*;
  14. /**
  15. * BasicPanel implementation
  16. *
  17. * @version 1.8 01/23/03
  18. * @author Steve Wilson
  19. */
  20. public class BasicPanelUI extends PanelUI {
  21. // Shared UI object
  22. private static PanelUI panelUI;
  23. public static ComponentUI createUI(JComponent c) {
  24. if(panelUI == null) {
  25. panelUI = new BasicPanelUI();
  26. }
  27. return panelUI;
  28. }
  29. public void installUI(JComponent c) {
  30. JPanel p = (JPanel)c;
  31. super.installUI(p);
  32. installDefaults(p);
  33. }
  34. public void uninstallUI(JComponent c) {
  35. super.uninstallUI(c);
  36. }
  37. protected void installDefaults(JPanel p) {
  38. LookAndFeel.installColorsAndFont(p,
  39. "Panel.background",
  40. "Panel.foreground",
  41. "Panel.font");
  42. LookAndFeel.installBorder(p,"Panel.border");
  43. }
  44. protected void uninstallDefaults(JPanel p) {
  45. LookAndFeel.uninstallBorder(p);
  46. }
  47. }