⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 texteditor.java

📁 SWING的界面UI包 SWING的界面UI包
💻 JAVA
字号:
/*
 * TextEditor.java
 *
 * Created on 2007年8月13日, 下午2:51
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */
package dyno.swing.designer.beans.editors;

import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JTextField;


/**
 *
 * @author William Chen
 */
public class TextEditor extends AbstractDesignerEditor {

    private JTextField editor;

    /** Creates a new instance of TextEditor */
    public TextEditor() {
        editor = new JTextField();
        editor.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                fireStateChanged();
            }
        });
    }

    public Component getEditorComponent() {
        return editor;
    }

    public void setValue(Object value) {
        editor.setText((value == null) ? "" : (String) value);
        editor.selectAll();
    }

    public Object getValue() {
        return editor.getText();
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -