public class

WindowsTextFieldUI

extends BasicTextFieldUI
java.lang.Object
   ↳ javax.swing.plaf.ComponentUI
     ↳ javax.swing.plaf.TextUI
       ↳ javax.swing.plaf.basic.BasicTextUI
         ↳ javax.swing.plaf.basic.BasicTextFieldUI
           ↳ com.sun.java.swing.plaf.windows.WindowsTextFieldUI

Class Overview

Provides the Windows look and feel for a text field. This is basically the following customizations to the default look-and-feel.

  • The border is beveled (using the standard control color).
  • The background is white by default.
  • The highlight color is a dark color, blue by default.
  • The foreground color is high contrast in the selected area, white by default. The unselected foreground is black.
  • The cursor blinks at about 1/2 second intervals.
  • The entire value is selected when focus is gained.
  • Shift-left-arrow and shift-right-arrow extend selection
  • Cntrl-left-arrow and cntrl-right-arrow act like home and end respectively.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence.

Summary

Public Constructors
WindowsTextFieldUI()
Public Methods
static ComponentUI createUI(JComponent c)
Creates a UI for a JTextField.
Protected Methods
Caret createCaret()
Creates the caret for a field.
void paintBackground(Graphics g)
Paints a background for the view.
[Expand]
Inherited Methods
From class javax.swing.plaf.basic.BasicTextFieldUI
From class javax.swing.plaf.basic.BasicTextUI
From class javax.swing.plaf.TextUI
From class javax.swing.plaf.ComponentUI
From class java.lang.Object
From interface javax.swing.text.ViewFactory

Public Constructors

public WindowsTextFieldUI ()

Public Methods

public static ComponentUI createUI (JComponent c)

Creates a UI for a JTextField.

Parameters
c the text field
Returns
  • the UI

Protected Methods

protected Caret createCaret ()

Creates the caret for a field.

Returns
  • the caret

protected void paintBackground (Graphics g)

Paints a background for the view. This will only be called if isOpaque() on the associated component is true. The default is to paint the background color of the component.

Parameters
g the graphics context