javax.swing.JTextPane.copy()方法的使用及代码示例

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

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

JTextPane.copy介绍

暂无

代码示例

代码示例来源:origin: org.orbisgis/orbisgis-view

/**
 * The user click on copy menu item
 */
public void onMenuCopy() {
  textPane.copy();
}
/**

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

/**
 * The user click on copy menu item
 */
public void onMenuCopy() {
  textPane.copy();
}
/**

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

/** Copy selected text to the clipboard. */
public void copySelectionToClipboard() {
  textPane.copy();
}

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

public void actionPerformed(ActionEvent event) {
  String cmd = event.getActionCommand();
  if (cmd.equals(CUT)) {
    text.cut();
  } else if (cmd.equals(COPY)) {
    text.copy();
  } else if (cmd.equals(PASTE)) {
    text.paste();
  }
}

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

public void cut() {
  if (text.getCaretPosition() < cmdStart) {
    super.copy();
  } else {
    super.cut();
  }
}

代码示例来源:origin: com.itextpdf/itext-rups

public void actionPerformed(ActionEvent e) {
  boolean nothingSelected = false;
  JTextPane textPane = (JTextPane) invoker;
  if (textPane.getSelectedText() == null || textPane.getSelectedText().trim().length() == 0) {
    nothingSelected = true;
    textPane.selectAll();
  }
  textPane.copy();
  if (nothingSelected) {
    textPane.select(0, 0);
  }
}

代码示例来源:origin: mars-sim/mars-sim

public MarsTerminal() {	
//        System.out.println("w: " + getFrame().getWidth()); // w: 656      
//        System.out.println("h: " + getFrame().getHeight()); // h: 519        
    this.getFrame().setSize(1024, 600);
    configureMainMenu();

    JTextPane textPane = getTextPane();
    addAction("ctrl C", "Copy", () -> textPane.copy());
    addAction("ctrl V", "Paste", () -> textPane.paste());
    MouseListener popupListener = new PopupListener(popup);
    textPane.addMouseListener(popupListener);
  }

代码示例来源:origin: Wimmics/corese

current.getTextPaneQuery().copy();

代码示例来源:origin: fr.inria.wimmics/kggui

current.getTextPaneQuery().copy();

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-ui

jtpSource.copy();
} else {
 jtpMain.copy();

代码示例来源:origin: mars-sim/mars-sim

public void setUpMouseCopyKey() {
   
   terminal.registerHandler("ctrl C", t -> {
     t.getTextPane().copy();
     return new ReadHandlerData(ReadInterruptionStrategy.Action.CONTINUE);
   });
   terminal.registerHandler("ctrl V", t -> {
//   	    t.getTextPane().paste();
     String selectedText = t.getTextPane().getSelectedText();
     if(selectedText != null) {
       t.getTextPane().setCaretPosition(t.getDocument().getLength());
       t.appendToInput(selectedText, false);
     }
     return new ReadHandlerData(ReadInterruptionStrategy.Action.CONTINUE);
   });
 }

相关文章

JTextPane类方法