Examples of JDialogFunctions


Examples of freegressi.tableur.JDialogFunctions

   * Insert une fonction dans un JTextComponent, en proposant
   * la boite de dialogue d'insertion d'une fonction.
   * @param textComponent le JTextComponent
   */ 
  public static void insertFunction(JTextComponent textComponent){
    JDialogFunctions jdf = new JDialogFunctions(null, true);
    jdf.setVisible(true);

    String strFunc = jdf.getText();
    int n = textComponent.getCaretPosition();
    StringBuilder sb = new StringBuilder(textComponent.getText());
    sb.insert(n, strFunc);
    textComponent.setText(sb.toString());
    // rendre le focus et positionner le caret
    textComponent.requestFocus();
    textComponent.setCaretPosition(n + strFunc.length());

    jdf.dispose();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.