1. /*
  2. * @(#)BasicPasswordFieldUI.java 1.26 00/02/02
  3. *
  4. * Copyright 1997-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.text.*;
  14. import javax.swing.event.*;
  15. import javax.swing.plaf.*;
  16. /**
  17. * Provides the Windows look and feel for a password field.
  18. * The only difference from the standard text field is that
  19. * the view of the text is simply a string of the echo
  20. * character as specified in JPasswordField, rather than the
  21. * real text contained in the field.
  22. *
  23. * @author Timothy Prinzing
  24. * @version 1.26 02/02/00
  25. */
  26. public class BasicPasswordFieldUI extends BasicTextFieldUI {
  27. /**
  28. * Creates a UI for a JPasswordField.
  29. *
  30. * @param c the JPasswordField
  31. * @return the UI
  32. */
  33. public static ComponentUI createUI(JComponent c) {
  34. return new BasicPasswordFieldUI();
  35. }
  36. /**
  37. * Fetches the name used as a key to look up properties through the
  38. * UIManager. This is used as a prefix to all the standard
  39. * text properties.
  40. *
  41. * @return the name ("PasswordField")
  42. */
  43. protected String getPropertyPrefix() {
  44. return "PasswordField";
  45. }
  46. /**
  47. * Creates a view (PasswordView) for an element.
  48. *
  49. * @param elem the element
  50. * @return the view
  51. */
  52. public View create(Element elem) {
  53. return new PasswordView(elem);
  54. }
  55. }