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

📄 channeleditor.java

📁 通讯采集软件
💻 JAVA
字号:
package collector.gui.guiVo;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class ChannelEditor
    extends DefaultCellEditor {

  public channel_obj m_channel_obj = null;

  public ChannelEditor(JButton b) {
    super(new JCheckBox()); //Unfortunately, the constructor
    editorComponent = b;
    setClickCountToStart(1); //This is usually 1 or 2.

    b.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        fireEditingStopped();
      }
    });
  }

  protected void fireEditingStopped() {
    super.fireEditingStopped();
  }

  public Object getCellEditorValue() {
    if (m_channel_obj == null) {
      return null;
    }
    else {
      return m_channel_obj;
    }
  }

  public Component getTableCellEditorComponent(JTable table,
                                               Object value,
                                               boolean isSelected,
                                               int row,
                                               int column) {
    if (value == null) {
      ( (JButton) editorComponent).setText("");
    }
    else {
      ( (JButton) editorComponent).setText( ( (channel_obj) value).toString());
    }
    m_channel_obj = (channel_obj) value;
    return editorComponent;
  }

}

⌨️ 快捷键说明

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