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