1. /*
  2. * @(#)SynthPasswordFieldUI.java 1.4 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 com.sun.java.swing.plaf.gtk;
  8. import javax.swing.*;
  9. import javax.swing.text.*;
  10. import javax.swing.plaf.*;
  11. /**
  12. * Provides the Synth look and feel for a password field.
  13. * The only difference from the standard text field is that
  14. * the view of the text is simply a string of the echo
  15. * character as specified in JPasswordField, rather than the
  16. * real text contained in the field.
  17. *
  18. * @author Shannon Hickey
  19. * @version 1.4 01/23/03 (based on revision 1.27 of BasicPasswordFieldUI)
  20. */
  21. class SynthPasswordFieldUI extends SynthTextFieldUI {
  22. /**
  23. * Creates a UI for a JPasswordField.
  24. *
  25. * @param c the JPasswordField
  26. * @return the UI
  27. */
  28. public static ComponentUI createUI(JComponent c) {
  29. return new SynthPasswordFieldUI();
  30. }
  31. /**
  32. * Fetches the name used as a key to look up properties through the
  33. * UIManager. This is used as a prefix to all the standard
  34. * text properties.
  35. *
  36. * @return the name ("PasswordField")
  37. */
  38. protected String getPropertyPrefix() {
  39. return "PasswordField";
  40. }
  41. /**
  42. * Creates a view (PasswordView) for an element.
  43. *
  44. * @param elem the element
  45. * @return the view
  46. */
  47. public View create(Element elem) {
  48. return new PasswordView(elem);
  49. }
  50. }