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

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

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

JTextArea.isEditable介绍

暂无

代码示例

代码示例来源:origin: net.sf.meka/meka

/**
 * Returns whether the text area is editable or not.
 *
 * @return        true if the text area is editable
 */
public boolean isEditable() {
  return m_TextCode.isEditable();
}

代码示例来源:origin: Waikato/meka

/**
 * Returns whether the text area is editable or not.
 *
 * @return        true if the text area is editable
 */
public boolean isEditable() {
  return m_TextCode.isEditable();
}

代码示例来源:origin: org.owasp.jbrofuzz/jbrofuzz

public void actionPerformed(final ActionEvent e) {
    if (area.isEditable()) {
      area.paste();
    }
  }
});

代码示例来源:origin: mikaelhg/openblocks

/**highlight this comment when a mouse hovers over this*/
public void mouseMoved(MouseEvent e) {
  if (textArea.isEditable()) {
    if (e.getX() > (width - 2 * margin) && e.getY() > (height - 2 * margin)) {
      Comment.this.setCursor(new Cursor(Cursor.SE_RESIZE_CURSOR));
    } else {
      jCompDH.mouseMoved(e);
    }
  } else {
    jCompDH.mouseMoved(e);
  }
}

代码示例来源:origin: mikaelhg/openblocks

/**
 * Recalculate the shape of this comment 
 */
public void reformComment() {
  int w = textArea.isEditable() ? (int) (this.width * zoom) : (int) (Comment.MINIMUM_WIDTH * zoom);
  int h = textArea.isEditable() ? (int) (this.height * zoom) : (int) (Comment.MINIMUM_HEIGHT * zoom);
  int m = (int) (this.margin * zoom);
  GeneralPath path2 = new GeneralPath();
  path2.moveTo(m - 1, m - 1);
  path2.lineTo(w - m, m - 1);
  path2.lineTo(w - m, h - m);
  path2.lineTo(m - 1, h - m);
  path2.closePath();
  textarea = path2;
  body = new RoundRectangle2D.Double(0, 0, w - 1, h - 1, 3 * m, 3 * m);
  GeneralPath path3 = new GeneralPath();
  path3.moveTo(w - 3 * m, h);
  path3.lineTo(w, h - 3 * m);
  path3.curveTo(w, h, w, h, w - 3 * m, h);
  resize = path3;
  scrollPane.setBounds(m, m, w - 2 * m, h - 2 * m);
  scrollPane.setThumbWidth(textArea.isEditable() ? 2 * m : 0);
  this.setBounds(this.getX(), this.getY(), w, h);
  this.revalidate();
  this.repaint();
  if (arrow != null) {
    arrow.updateArrow();
  }
}

代码示例来源:origin: mikaelhg/openblocks

/**prepare for a drag when mouse is pressed down*/
public void mousePressed(MouseEvent e) {
  Comment.this.grabFocus();  //atimer.stop();
  showOnTop();
  jCompDH.mousePressed(e);
  if (textArea.isEditable()) {
    if (e.getX() > (width - 2 * margin) && e.getY() > (height - 2 * margin)) {
      setResizing(true);
    } else {
      if (e.getY() < margin) {
        setPressed(true);
      }
    }
  } else if (e.getY() < margin) {
    setPressed(true);
  }
  repaint();
}

代码示例来源:origin: org.tentackle/tentackle-swing

if (newColor == null && !c.isEditable()) {
 newColor = inactiveBG;

代码示例来源:origin: org.owasp.jbrofuzz/jbrofuzz

popmenu.add(i4_select);
if (!area.isEditable()) {
  i3_paste.setEnabled(false);
  i1_cut.setEnabled(false);

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

if (commentTextArea.isEditable()) {
  remarks = commentTextArea.getText();

代码示例来源:origin: triplea-game/triplea

@Test
public void defaultValues() {
 final JTextArea area = JTextAreaBuilder.builder()
   .build();
 assertThat(area.getWrapStyleWord(), is(true));
 assertThat(area.isEditable(), is(true));
}

代码示例来源:origin: realXuJiang/bigtable-sql

if (commentTextArea.isEditable()) {
  remarks = commentTextArea.getText();

代码示例来源:origin: triplea-game/triplea

@Test
 public void readOnly() {
  final JTextArea area = JTextAreaBuilder.builder()
    .readOnly()
    .build();
  assertThat(area.isEditable(), is(false));
 }
}

相关文章

JTextArea类方法