Returns the text editor component for the specified combo box. - Java Swing

Java examples for Swing:JComboBox

Description

Returns the text editor component for the specified combo box.

Demo Code

/*//ww  w. j a  v a2 s  . c om
 * 09/08/2005
 *
 * UIUtil.java - Utility methods for org.fife.rsta.ui classes.
 * This library is distributed under a modified BSD license.  See the included
 * RSTAUI.License.txt file for details.
 */
//package com.java2s;

import javax.swing.JComboBox;

import javax.swing.text.JTextComponent;

public class Main {
    /**
     * Returns the text editor component for the specified combo box.
     *
     * @param combo The combo box.
     * @return The text component.
     */
    public static final JTextComponent getTextComponent(JComboBox combo) {
        return (JTextComponent) combo.getEditor().getEditorComponent();
    }
}

Related Tutorials