W3cubDocs

/OpenJDK 8 GUI

Class DefaultTreeCellEditor.DefaultTextField

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable, SwingConstants
Enclosing class:
DefaultTreeCellEditor
public class DefaultTreeCellEditor.DefaultTextField
extends JTextField

TextField used when no editor is supplied. This textfield locks into the border it is constructed with. It also prefers its parents font over its font. And if the renderer is not null and no font has been specified the preferred height is that of the renderer.

Nested Classes

Nested classes/interfaces inherited from class javax.swing.JTextField

JTextField.AccessibleJTextField

Nested classes/interfaces inherited from class javax.swing.text.JTextComponent

JTextComponent.AccessibleJTextComponent, JTextComponent.DropLocation, JTextComponent.KeyBinding

Nested classes/interfaces inherited from class javax.swing.JComponent

JComponent.AccessibleJComponent

Nested classes/interfaces inherited from class java.awt.Container

Container.AccessibleAWTContainer

Nested classes/interfaces inherited from class java.awt.Component

Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy

Fields

border

protected Border border

Border to use.

Constructors

DefaultTextField

public DefaultTextField(Border border)

Constructs a DefaultTreeCellEditor.DefaultTextField object.

Parameters:
border - a Border object
Since:
1.4

Methods

setBorder

public void setBorder(Border border)

Sets the border of this component.

This is a bound property.

Overrides:
setBorder in class JComponent
Parameters:
border - the border to be rendered for this component
See Also:
Border, CompoundBorder

getBorder

public Border getBorder()

Overrides JComponent.getBorder to returns the current border.

Overrides:
getBorder in class JComponent
Returns:
the border object for this component
See Also:
JComponent.setBorder(javax.swing.border.Border)

getFont

public Font getFont()

Description copied from class: Component

Gets the font of this component.

Specified by:
getFont in interface MenuContainer
Overrides:
getFont in class Component
Returns:
this component's font; if a font has not been set for this component, the font of its parent is returned
See Also:
Component.setFont(java.awt.Font)

getPreferredSize

public Dimension getPreferredSize()

Overrides JTextField.getPreferredSize to return the preferred size based on current font, if set, or else use renderer's font.

Overrides:
getPreferredSize in class JTextField
Returns:
a Dimension object containing the preferred size
See Also:
JComponent.setPreferredSize(java.awt.Dimension), ComponentUI

© 1993–2017, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.