javax.swing.JTextArea.addKeyListener()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(8.7k)|赞(0)|评价(0)|浏览(187)

本文整理了Java中javax.swing.JTextArea.addKeyListener()方法的一些代码示例,展示了JTextArea.addKeyListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextArea.addKeyListener()方法的具体详情如下:
包路径:javax.swing.JTextArea
类名称:JTextArea
方法名:addKeyListener

JTextArea.addKeyListener介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

area.addKeyListener(new KeyAdapter() {
  private StringBuffer line = new StringBuffer();
  @Override public void keyTyped(KeyEvent e) {

代码示例来源:origin: JetBrains/ideavim

private ExOutputPanel(@NotNull Editor editor) {
 myEditor = editor;
 // Create a text editor for the text and a label for the prompt
 BorderLayout layout = new BorderLayout(0, 0);
 setLayout(layout);
 add(myScrollPane, BorderLayout.CENTER);
 add(myLabel, BorderLayout.SOUTH);
 setFontForElements();
 myText.setBorder(null);
 myScrollPane.setBorder(null);
 myLabel.setForeground(myText.getForeground());
 myLabel.setBackground(myText.getBackground());
 setForeground(myText.getForeground());
 setBackground(myText.getBackground());
 myText.setEditable(false);
 setBorder(BorderFactory.createEtchedBorder());
 myAdapter = new ComponentAdapter() {
  public void componentResized(ComponentEvent e) {
   positionPanel();
  }
 };
 // Setup some listeners to handle keystrokes
 MoreKeyListener moreKeyListener = new MoreKeyListener(this);
 addKeyListener(moreKeyListener);
 myText.addKeyListener(moreKeyListener);
}

代码示例来源:origin: geotools/geotools

public void addListener(Controller controller) {
  text.addKeyListener(controller);
}

代码示例来源:origin: geotools/geotools

public void removeListener(Controller controller) {
  text.addKeyListener(controller);
}

代码示例来源:origin: geotools/geotools

public JComponent doLayout() {
  text = new JTextArea(40, 3);
  text.addKeyListener(
      new KeyAdapter() {
        public void keyReleased(KeyEvent e) {
          validate();
        }
      });
  text.setWrapStyleWord(true);
  JScrollPane scroll =
      new JScrollPane(
          text,
          JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
          JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
  scroll.setPreferredSize(new Dimension(400, 80));
  return scroll;
}

代码示例来源:origin: opensourceBIM/BIMserver

logField.addKeyListener(new KeyAdapter() {
  @Override
  public void keyPressed(KeyEvent e) {

代码示例来源:origin: bobbylight/RSyntaxTextArea

public void install(JTextArea textArea) {
  textArea.addCaretListener(this);
  textArea.addComponentListener(this);
  textArea.addFocusListener(this);
  textArea.addKeyListener(this);
  textArea.addMouseListener(this);
  textArea.addMouseMotionListener(this);
}

代码示例来源:origin: fr.ifremer/isis-fish

protected void createFieldPopulationCapturabilityComment() {
  $objectMap.put("fieldPopulationCapturabilityComment", fieldPopulationCapturabilityComment = new JTextArea());
  
  fieldPopulationCapturabilityComment.setName("fieldPopulationCapturabilityComment");
  fieldPopulationCapturabilityComment.setColumns(15);
  fieldPopulationCapturabilityComment.setLineWrap(true);
  fieldPopulationCapturabilityComment.setWrapStyleWord(true);
  fieldPopulationCapturabilityComment.addKeyListener(JAXXUtil.getEventListener(KeyListener.class, "keyReleased", this, "doKeyReleased__on__fieldPopulationCapturabilityComment"));
}

代码示例来源:origin: fr.ifremer/isis-fish

protected void createFieldComment() {
  $objectMap.put("fieldComment", fieldComment = new JTextArea());
  
  fieldComment.setName("fieldComment");
  fieldComment.setColumns(15);
  fieldComment.setLineWrap(true);
  fieldComment.setWrapStyleWord(true);
  fieldComment.addKeyListener(JAXXUtil.getEventListener(KeyListener.class, "keyReleased", this, "doKeyReleased__on__fieldComment"));
}

代码示例来源:origin: fr.ifremer/isis-fish

protected void createFieldPopulationBasicsComment() {
  $objectMap.put("fieldPopulationBasicsComment", fieldPopulationBasicsComment = new JTextArea());
  
  fieldPopulationBasicsComment.setName("fieldPopulationBasicsComment");
  fieldPopulationBasicsComment.setColumns(15);
  fieldPopulationBasicsComment.setLineWrap(true);
  fieldPopulationBasicsComment.setWrapStyleWord(true);
  fieldPopulationBasicsComment.addKeyListener(JAXXUtil.getEventListener(KeyListener.class, "keyReleased", this, "doKeyReleased__on__fieldPopulationBasicsComment"));
}

代码示例来源:origin: fr.ifremer/isis-fish

protected void createFieldSetOfVesselsComment() {
  $objectMap.put("fieldSetOfVesselsComment", fieldSetOfVesselsComment = new JTextArea());
  
  fieldSetOfVesselsComment.setName("fieldSetOfVesselsComment");
  fieldSetOfVesselsComment.setColumns(15);
  fieldSetOfVesselsComment.setLineWrap(true);
  fieldSetOfVesselsComment.setWrapStyleWord(true);
  fieldSetOfVesselsComment.addKeyListener(JAXXUtil.getEventListener(KeyListener.class, "keyReleased", this, "doKeyReleased__on__fieldSetOfVesselsComment"));
}

代码示例来源:origin: fr.ifremer/isis-fish

protected void createFieldVesselTypeComment() {
  $objectMap.put("fieldVesselTypeComment", fieldVesselTypeComment = new JTextArea());
  
  fieldVesselTypeComment.setName("fieldVesselTypeComment");
  fieldVesselTypeComment.setColumns(15);
  fieldVesselTypeComment.setLineWrap(true);
  fieldVesselTypeComment.setWrapStyleWord(true);
  fieldVesselTypeComment.addKeyListener(JAXXUtil.getEventListener(KeyListener.class, "keyReleased", this, "doKeyReleased__on__fieldVesselTypeComment"));
}

代码示例来源:origin: fr.ifremer/isis-fish

protected void createFieldMetierComment() {
  $objectMap.put("fieldMetierComment", fieldMetierComment = new JTextArea());
  
  fieldMetierComment.setName("fieldMetierComment");
  fieldMetierComment.setColumns(15);
  fieldMetierComment.setLineWrap(true);
  fieldMetierComment.setWrapStyleWord(true);
  fieldMetierComment.addKeyListener(JAXXUtil.getEventListener(KeyListener.class, "keyReleased", this, "doKeyReleased__on__fieldMetierComment"));
}

代码示例来源:origin: fr.ifremer/isis-fish

protected void createFieldCellComment() {
  $objectMap.put("fieldCellComment", fieldCellComment = new JTextArea());
  
  fieldCellComment.setName("fieldCellComment");
  fieldCellComment.setColumns(15);
  fieldCellComment.setLineWrap(true);
  fieldCellComment.setWrapStyleWord(true);
  fieldCellComment.addKeyListener(JAXXUtil.getEventListener(KeyListener.class, "keyReleased", this, "doKeyReleased__on__fieldCellComment"));
}

代码示例来源:origin: fr.ifremer/isis-fish

protected void createFieldStrategyComment() {
  $objectMap.put("fieldStrategyComment", fieldStrategyComment = new JTextArea());
  
  fieldStrategyComment.setName("fieldStrategyComment");
  fieldStrategyComment.setColumns(15);
  fieldStrategyComment.setLineWrap(true);
  fieldStrategyComment.setWrapStyleWord(true);
  fieldStrategyComment.addKeyListener(JAXXUtil.getEventListener(KeyListener.class, "keyReleased", this, "doKeyReleased__on__fieldStrategyComment"));
}

代码示例来源:origin: fr.ifremer/isis-fish

protected void createFieldPopulationGroupComment() {
  $objectMap.put("fieldPopulationGroupComment", fieldPopulationGroupComment = new JTextArea());
  
  fieldPopulationGroupComment.setName("fieldPopulationGroupComment");
  fieldPopulationGroupComment.setColumns(15);
  fieldPopulationGroupComment.setLineWrap(true);
  fieldPopulationGroupComment.setWrapStyleWord(true);
  fieldPopulationGroupComment.addKeyListener(JAXXUtil.getEventListener(KeyListener.class, "keyReleased", this, "doKeyReleased__on__fieldPopulationGroupComment"));
}

代码示例来源:origin: fr.ifremer/isis-fish

protected void createFieldPopulationSeasonComment() {
  $objectMap.put("fieldPopulationSeasonComment", fieldPopulationSeasonComment = new JTextArea());
  
  fieldPopulationSeasonComment.setName("fieldPopulationSeasonComment");
  fieldPopulationSeasonComment.setColumns(15);
  fieldPopulationSeasonComment.setLineWrap(true);
  fieldPopulationSeasonComment.setWrapStyleWord(true);
  fieldPopulationSeasonComment.addKeyListener(JAXXUtil.getEventListener(KeyListener.class, "keyReleased", this, "doKeyReleased__on__fieldPopulationSeasonComment"));
}

代码示例来源:origin: nl.cloudfarming.client/nbtaskfocus-core

public TaskEditorTopComponent(Task task) {
  this();
  this.task = task;
  setName("Task id: " + task.getTaskId());
  setToolTipText(NbBundle.getMessage(TaskEditorTopComponent.class, "HINT_TaskEditorTopComponent"));
  
  readValues();
  taskNameField.addKeyListener(
    WeakListeners.create( KeyListener.class, keyListener, taskNameField));
  taskDescriptionField.addKeyListener(
    WeakListeners.create( KeyListener.class, keyListener, taskDescriptionField));        
  
}

代码示例来源:origin: com.fifesoft/rsyntaxtextarea

public void install(JTextArea textArea) {
  textArea.addCaretListener(this);
  textArea.addComponentListener(this);
  textArea.addFocusListener(this);
  textArea.addKeyListener(this);
  textArea.addMouseListener(this);
  textArea.addMouseMotionListener(this);
}

代码示例来源:origin: org.nuiton.thirdparty/rsyntaxtextarea

public void install(JTextArea textArea) {
  textArea.addCaretListener(this);
  textArea.addComponentListener(this);
  textArea.addFocusListener(this);
  textArea.addKeyListener(this);
  textArea.addMouseListener(this);
  textArea.addMouseMotionListener(this);
}

相关文章

JTextArea类方法