Package vg.modules.notepad.components.textComponent

Examples of vg.modules.notepad.components.textComponent.TextComponent


    // good
    this.setVisible(false);
  }
  private ITextComponent open(File input) {
    //to erase any text in the text area before adding new text
    ITextComponent textComponent = new TextComponent();
    StringBuffer str = new StringBuffer(1024*4);
    Reader in = null;
    try{
      //to read the selected file
      in = new FileReader(input);
      //100000 is the max. char can be written in the text area
      char[] buff = new char[100000];
      int nch;
      while((nch = in.read(buff, 0, buff.length)) != -1) {
        str.append(new String(buff, 0, nch));
      }
      textComponent.setText(str.toString());
      return(textComponent);
    } catch(Exception ex){
      VisualGraph.log.printException(ex);
    } finally {
      if(in != null) {
View Full Code Here

TOP

Related Classes of vg.modules.notepad.components.textComponent.TextComponent

Copyright © 2018 www.massapicom. 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.