JTextArea to String

I'm writing a program that is essentially a basic text editor. I am trying to pass the text from the JTextArea to a seperate class which will be a "Find Text" dialog. What is the best way to go about doing this?
Thanks in advance for any help!

I think its better to pass the actual text component because you will ultimately want to hightlight the found text so you need access to the text component. Here's an [url http://www.discoverteenergy.com/files/FindReplace.java]example.

Similar Messages

  • How to Convert JTextArea to String

    How would i convert JTextArea to string?

    elaborate, whats RTFAPI? I searched for it and got
    nothing.Since I'm not quite sure if you are being sarcastic, that translates to "read the f*cking application programmer interface". :)

  • Tokenizing a JTextArea(how do i make the JTextArea a string?)

    I am working on this text analyzer program which is kinda like a replica of what you find when you a do a word count in many office suites. It tells you stuff like number of sentences, longest sentence, shortest sentence and average length. Number of words, longest shortest and average word length. In addtion there is a word search to it.
    It took me a good 3 hours to realize that there was such a thing as a panel and I could impliment this to add more than one object to a borderlayout section.
    I think I have figured out everything with the StringTokenizer part, well except for how do add it to an array. Someone mentioned something to me about an
    islist.StringTokenizer or something, but I haven't been able to find anything else on this.
    Right now, however, my primary concern is how can I take input from a JTextArea and be able to parse it with the StringTokenizer, which to the best of my knowledge has to be a string. It this as simple as a getValue(); type thing or do i have to add some sort of action listener that finds out when it changes or something?
    thank you for your time

    I just figued out the JTextArea thing
    it is JTextArea.getText();
    im stupid :P

  • How to get InputStream from JTextArea.getText() string?

    hello,
    well the postname pretty much says it, i need to get an InputStream for the String of a JTextArea.
    thing is, i want to save the string in a textfile, but the new line isnt recognized when i write it to the file.
    FileWriter fw = new FileWriter ("text.txt");
    fw.write(editField.getText());  // editField is my JTextArea instanceso i thought of doing smth like this
    String lineSeparator = System.getProperty("line.separator");
    // somehow getting the InputStream for my editField and save it in "is"
    BufferedReader br = new BufferedReader(new InputStreamReader (is));
    String line;
    while ((line = br.readLine()) != null) {
    fw.write(line);
    fw.write(lineSeparator);
    }

    pSaiko wrote:
    hello,
    well the postname pretty much says it, i need to get an InputStream for the String of a JTextArea.
    thing is, i want to save the string in a textfile, but the new line isnt recognized when i write it to the file.
    FileWriter fw = new FileWriter ("text.txt");
    fw.write(editField.getText());  // editField is my JTextArea instanceso i thought of doing smth like this
    String lineSeparator = System.getProperty("line.separator");
    // somehow getting the InputStream for my editField and save it in "is"
    BufferedReader br = new BufferedReader(new InputStreamReader (is));
    String line;
    while ((line = br.readLine()) != null) {
    fw.write(line);
    fw.write(lineSeparator);
    This is very simple, it isn't buffered, but it should work for you.
    Sting s = editfield.getText();
    for(int i=0; i<s.length();i++) fw.write((int)s.charAt(i));
    fw.flush();
    fw.close();

  • JTextArea methods + String Handling

    Hi There,
    My Question was, that i have made a small text editor application, and i was hoping that some one could tell me how to add the text, which is opened in a JTextArea to a Vector (or another data structure if this is more appropriate), which i can then parse using Regular expressions??
    Also, could u point me in the direction of a resource that has examples of how to use regular expressions in java 1.4 (util.regex)?
    Thanks in advance,
    much appreciated!

    I'd use getText() and put the text in a String, like the previous poster said. From there you can parse the string using the Pattern and Matcher objects.
    Here's a link that has some examples of regular expressions:
    http://developer.java.sun.com/developer/technicalArticles/releases/1.4regex/

  • JTextArea.setText("String ") not updating the GUI.

    Hi,
    When i tried to update the JTextArea with a new String it is not replacing the string in the TextArea.
    If I try to print the content by retrieving the data in the TextArea using JTextArea.getText() it is showing the latest string set to the JTextArea.
    What might be the problem?
    DP

    Here is the code. I am calling the displayMessage() from onMessage() method.
    private void displayMessage(String str){
         textArea.setText(str);
         textArea.revalidate();
         System.out.println("Message Received from QUE: "+ textArea.getText());
    public void onMessage(Message msg) {
    try {
    if (msg instanceof TextMessage) {
         msgText = ((TextMessage)msg).getText();
    } else {
         msgText = msg.toString();
         msgText = msgText.trim();
    System.out.println(msgText );
    displayMessage(msgText);

  • Question on JTextArea.append(String str)

    Hi All,
    When i provide JTextArea.append("FMTL") it is showing me on the JTextArea but when i give it as
    String item="Viswanadh";
    JTextArea.append(item).this particular statement is remaming blank on the TextArea.
    Any idea why this is happening and is there any other method to be used instead of append.???
    Thanks in advance..
    regards,
    Viswanadh

    class OnApplyFormat implements ActionListener{
         public void actionPerformed(ActionEvent formatevent){
              JComboBox source = (JComboBox) formatevent.getSource();
                   String item =  source.getSelectedItem().toString();
                     System.out.println("Selected Format is:"+item);
                     try
                       if ( item!=null )
                              System.out.println("Format is:"+item);
                     infoarea.append("FMTL");
                   infoarea.append(item);
                     infoarea.append("\r\n");
                   infoarea.append("FMTU");
                   infoarea.append("\r\n");
                   infoarea.append("wait 5");
                   infoarea.append("\r\n");
              else
                   throw new Exception("FormatNotFoundException");
                          }catch(Exception e){
                          e.printStackTrace();
    }That is my code and still i am facing the same FMTL is not getting appended with the item variable.
    Help me in solving this issue.
    Thanks in advance.
    regards,
    Viswanadh

  • JTextField or JTextArea to string?

    I am a bit rusty on my Java and have recently been kinda reteaching myself it. I created an applet to write some HTML code. my first problem is that i can not figure out how to use the input in a JTextField or JTextArea as part of a StringBuffer. I have tried a couple different things and can't figure it out. my next problem is i am using JOptionPane's for an undertermined number of variables. is there some way to add an undertermined number of pane.add(). also, i need to beable to paste things into the input areas, is there some way to do it? thanks

    An important skill to have as a software developer is the ability to look up the API documentation.
    http://java.sun.com/j2se/1.4.2/docs/api/index.html (for 1.4.2 - substitute 1.5.0 in the URL for 1.4.2 for that version if you wish)
    For example, for JTextField, it would appear you'd need to simply invoke the getText() method to get the text contained therein.

  • Problems with string array, please help!

    I have a String array floor[][], it has 20 rows and columns
    After I do some statement to modify it, I print this array
    out in JTextArea, why the output be like this?
    null* null....
    null null...
    null null...
    How to correct it?

    a turtle graphics applet:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class TG extends JApplet implements ActionListener {
      private int x, y;
      private int pendown, command, movement;
      String direction, output, temp;
      JLabel l1;
      JTextField tf1;
      JTextArea ta1;
      String floor[][] = new String[20][20];;
      public void init()
        x = 0;
        y = 0;
        pendown = 0;
        direction = "r";
        Container c = getContentPane();
        c.setLayout( new FlowLayout() );
           l1 = new JLabel( "Please type a command:" );
           c.add( l1 );
           tf1 = new JTextField(20);
           tf1.addActionListener( this );
           c.add( tf1 );
           ta1 = new JTextArea(20,20);
           ta1.setEditable( false );
           c.add( ta1 );
    public void actionPerformed( ActionEvent e )
           temp = tf1.getText();
           if( temp.length() > 1)
           command = Integer.parseInt(temp.substring(0,1));
           movement = Integer.parseInt(temp.substring(2,temp.length()));
           else
           command = Integer.parseInt(temp);
           switch(command)
                case 1:
                pendown=0;
                break;
                case 2:
                pendown=1;
                break;
                case 3:
                direct("r");
                break;
                case 4:
                direct("l");
                break;
                case 5:
               move(movement);           
                break;
                case 6:
                print();
                break;                                     
      public void direct(String s)
           if(direction == "r" && s =="r")
              direction = "d";
           else if(direction == "r" && s =="l")
              direction = "u";
           else if(direction == "l" && s =="r")
              direction = "u";
           else if(direction == "l" && s =="l")
              direction = "d";
           else if(direction == "u" && s =="r")
              direction = "r";
           else if(direction == "u" && s =="l")
              direction = "l";
           else if(direction == "d" && s =="r")
              direction = "l";
           else if(direction == "d" && s =="l")
              direction = "r";
      public void move(int movement)
           if(pendown == 1)
                if(direction == "u")
                for(int b=0;b<movement;b++)
                     floor[x][y+b] = "*";
                else if(direction == "d")
                for(int b=0;b<movement;b++)
                     floor[x][y-b] = "*";
                else if(direction == "l")
                for(int b=0;b<movement;b++)
                     floor[x-b][y] = "*";
                else if(direction == "r")
                for(int b=0;b<movement;b++)
                     floor[x+b][y] = "*";
            else if(pendown == 0)
                 if(direction == "u")
                for(int b=0;b<movement;b++)
                     floor[x][y+b] = "-";
                else if(direction == "d")
                for(int b=0;b<movement;b++)
                     floor[x][y-b] = "-";
                else if(direction == "l")
                for(int b=0;b<movement;b++)
                     floor[x-b][y] = "-";
                else if(direction == "r")
                for(int b=0;b<movement;b++)
                     floor[x+b][y] = "-";
          public void print()
         for(int row=0;row<20;row++)
           for( int column=0;column<20;column++)
                output += floor[row][column];
                if(column == 19)
                 output+="\n";
            ta1.setText(output);
    }

  • Passing variables in an array to jtextarea?

    What method could I use to pass different Strings in an array to a jtextarea each time the "Next" button (a JButton) in my JFrame is pressed? So, for example, if i hit next, i might want the word "frank" to print in the jtextarea, but the next time i hit it, i might want it to print "joe" Thank you!!
    This is my code:
    public class discardedSaluteMyShorts extends JPanel implements ActionListener
        JTextArea textArea;
        String newline = "\n";
        static final public String NEXT = "next";
        public discardedSaluteMyShorts()
            super(new BorderLayout());
            //Create the toolbar.
            JToolBar toolBar = new JToolBar("Still draggable");
            addButtons(toolBar);
            //Create the text area used for output.  Request
            //enough space for 5 rows and 30 columns.
            textArea = new JTextArea(5, 30);
            textArea.setEditable(false);
            JScrollPane scrollPane = new JScrollPane(textArea);
            //Lay out the main panel.
            setPreferredSize(new Dimension(450, 130));
            add(toolBar, BorderLayout.PAGE_START);
            add(scrollPane, BorderLayout.CENTER);
        public void addButtons(JToolBar toolBar)
            JButton button = null;
            //third button
            button = makeNavigationButton("Forward24", NEXT,
                    "Next light or sound cue",
                    "Next");
            toolBar.add(button);
        public JButton makeNavigationButton(String imageName,
                String actionCommand,
                String toolTipText,
                String altText)
            //Look for the image.
            String imgLocation = "images/"
                    + imageName
                    + ".gif";
            URL imageURL = discardedSaluteMyShorts.class.getResource(imgLocation);
            //Create and initialize the button.
            JButton button = new JButton();
            button.setActionCommand(actionCommand);
            button.setToolTipText(toolTipText);
            button.addActionListener(this);
            if (imageURL != null)
            {                      //image found
                button.setIcon(new ImageIcon(imageURL, altText));
            else
            {                                     //no image found
                button.setText(altText);
                System.err.println("Resource not found: "
                        + imgLocation);
            return button;
        public void actionPerformed(ActionEvent e)
            String cmd = e.getActionCommand();
            String cmd1 = e.getActionCommand();
            String description="";
            String description1 = "";
            String description2 = "";
            // Handle each button.
            if (NEXT.equals(cmd))
            { // third button clicked
                description="23 up";
                description1 ="23 down";
                description2="adsfsd";
                displayResult(description, description1, description2);
        public void displayResult(String description, String description1, String description2)
            JButton button = new JButton();
            button.getActionCommand();
            textArea.append(description + newline);//adds description to document
            if(button.getActionCommand()!=null)
            textArea.append(description1 + newline);
            textArea.append(description2 + newline);
            textArea.setCaretPosition(textArea.getDocument().getLength());//scrolls down
        public void nextCue1()
            String description2 = "asdfasasdf";
            displayResult2(""+description2);
        public void displayResult2(String description2)
            String description3 = ".";
            textArea.append(description2 + newline);//adds description to document
            textArea.setCaretPosition(textArea.getDocument().getLength());//scrolls down
        public void displayResult3(String description3)
            textArea.append(description3 + newline);//adds description to document
            textArea.setCaretPosition(textArea.getDocument().getLength());//scrolls down
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event dispatch thread.
        public static void createAndShowGUI()
            //Create and set up the window.
            JFrame frame = new JFrame("ToolBarDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Add content to the window.
            frame.add(new discardedSaluteMyShorts());
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args)
            //Schedule a job for the event dispatch thread:
            //creating and showing this application's GUI.
            SwingUtilities.invokeLater(new Runnable()
                public void run()
                    //Turn off metal's use of bold fonts
                    createAndShowGUI();
    }Edited by: cubswar on Apr 1, 2008 8:47 PM

    First you declare the array and the index you currently are on in your class on the global variables section so for example:
    public class discardedSaluteMyShorts extends JPanel implements ActionListener {
        private int index = 0;
        private String arr[] = new String[] { "frank", "joe" };
        // The code would be here
    }Then in the method which displays the next value:
    public void showNextValue() {
        textArea.setText(arr[index]);
        index = (index + 1) % arr.length;
    }You probably want to call the method from the action performed of the button.

  • How to write selected text in JTextArea in selected location

    iam using JTextArea ...
    i want to writer selected text in selected location,,,,,,

    use
    JTextArea.getSelectedText() and
    JTextArea.replaceRange(String str, int start, int end)
    methods.

  • How to clear JTextArea

    Hi,
    I am trying to clear the JTextArea when the user clicks on a button. I could not find a clear command in the JavaDocs but I did try the following:
    Is there a better way to do this or a different object.
    Thanks,
    Steve
    String abc = " ";
    int xcoord = 0;
    int ycoord = 40;
    msgout.replaceRange(abc, xcoord, ycoord);

    use a setText method.
    JTextArea.setText(String);
    if you wanted to make it blank...
    String str = "";
    JTextArea.setText(str);

  • JTextArea question(setting a large text)

    Hi,
    I watched a kind of problem using the
    JTextArea.apped(String string);I read a long file(>2MB) into a byte[] create a String with this array and try to append
    this long string with the append method into the text area.
    The problem now is, that the app freezes...
    If I append only a substring of a smaller size(maybe 200 chars) everything works fine.
    Anyone have recongnized the same behavior? The method
    JTextArea.setText(String s);don't work too.
    Olek

    I read a long file(>2MB) into a byte[] create a String with this arraySo you have a copy of the file:
    a) in a byte array
    b) in a String
    c) in the Document of the text area
    So you have 3 copies of the file in memory. Not very efficient.
    Use the read(...) method of the text area to load the data directly into the Document.

  • JTextArea with freeze pane functionality

    Greetings. I am trying to implement a plain text viewer that has some sort of "freeze pane" functionality (like that found in MS Excel)
    I took the approach of using 4 JTextArea and put them into a JScrollPane, its row header, column header and upper-left corner. All these text areas share the same document.
    Everything works as expected. When I scroll the lower-right pane, the row and column headers scroll correspondingly. The problem I have is that the document in the lower-right pane now shows duplicate portion of the document that is already showing in the row and column headers.
    Knowing that this should merely be a matter of shifting the Viewport on the document, I went through the documentation and java source, and just couldn't find a way to translate the view. SetViewPosition() works to a certain extent, but the scrollbars allow users to scroll back to the origin and reveal the duplicate data, which is undesirable.
    Your help with find out a way to relocate the view to the desired location is much appreciated.
    khsu

    some sample code attached (with a quick hack in attempt to making it work, at least presentation-wise)
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.*;
    import javax.swing.plaf.*;
    import javax.swing.plaf.basic.*;
    import javax.swing.text.*;
    public class SplitViewFrame extends JFrame {
        int splitX = 100;
        int splitY = 100;
        public static void main(String[] args) {
            // Create application frame.
            SplitViewFrame frame = new SplitViewFrame();
            // Show frame
            frame.setVisible(true);
         * The constructor.
         public SplitViewFrame() {
            JMenuBar menuBar = new JMenuBar();
            JMenu menuFile = new JMenu();
            JMenuItem menuFileExit = new JMenuItem();
            menuFile.setLabel("File");
            menuFileExit.setLabel("Exit");
            // Add action listener.for the menu button
            menuFileExit.addActionListener
                new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        SplitViewFrame.this.windowClosed();
            menuFile.add(menuFileExit);
            menuBar.add(menuFile);
            setTitle("SplitView");
            setJMenuBar(menuBar);
            setSize(new Dimension(640, 480));
            // Add window listener.
            this.addWindowListener
                new WindowAdapter() {
                    public void windowClosing(WindowEvent e) {
                        SplitViewFrame.this.windowClosed();
            makeFreezePane();
        void makeFreezePane() {
            Container cp = getContentPane();
            Font font = new Font("monospaced", Font.PLAIN, 14);
            OffsetTextArea ta = new OffsetTextArea();
            ta.setSplit(splitX, splitY);
            ta.setOpaque(false);
            ta.setFont(font);
            // read doc
            readDocIntoTextArea(ta, "..\\afscheck.txt");
            JScrollPane jsp = new JScrollPane(ta);
            jsp.getViewport().setBackground(Color.white);
            Document doc = ta.getDocument();
            // dump doc
            //dumpDocument(doc);
            JViewport ulVP = makeViewport(doc, font, 0, 0, splitX, splitY);
            JViewport urVP = makeViewport(doc, font, splitX, 0, 20, splitY);
            JViewport llVP = makeViewport(doc, font, 0, splitY, splitX, 20);
            jsp.setRowHeader(llVP);
            jsp.setColumnHeader(urVP);
            jsp.setCorner(JScrollPane.UPPER_LEFT_CORNER, ulVP);
            jsp.setCorner(JScrollPane.UPPER_RIGHT_CORNER, new Corner());
            jsp.setCorner(JScrollPane.LOWER_LEFT_CORNER, new Corner());
            jsp.setCorner(JScrollPane.LOWER_RIGHT_CORNER, new Corner());
            cp.setLayout(new BorderLayout());
            cp.add(jsp, BorderLayout.CENTER);
        void readDocIntoTextArea(JTextArea ta, String filename) {
            try {
                File f = new File(filename);
                FileInputStream fis = new FileInputStream(f);
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                int br = 0;
                byte[] buf = new byte[1024000];
                while ((br = fis.read(buf, 0, buf.length)) != -1) {
                    baos.write(buf, 0, br);
                fis.close();
                ta.setText(baos.toString());
            } catch (Exception e) {
                e.printStackTrace();
                ta.setText("Failed to load text.");
        protected void windowClosed() {
            System.exit(0);
        JViewport makeViewport(Document doc, Font f, int splitX, int splitY, int width, int height) {
            JViewport vp = new JViewport();
            OffsetTextArea ta = new OffsetTextArea();
            ta.setSplit(splitX, splitY);
            ta.setDocument(doc);
            ta.setFont(f);
            ta.setBackground(Color.gray);
            vp.setView(ta);
            vp.setBackground(Color.gray);
            vp.setPreferredSize(new Dimension(width, height));
            return vp;
        static void dumpDocument(Document doc) {
            Element[] elms = doc.getRootElements();
            for (int i = 0; i < elms.length; i++) {
                dumpElement(elms, 0);
    static void dumpElement(Element elm, int level) {
    for (int i = 0; i < level; i++) System.out.print(" ");
    System.out.print(elm.getName());
    if ( elm.isLeaf() && elm.getName().equals("content")) {
    try {
    int s = elm.getStartOffset();
    int e = elm.getEndOffset();
    System.out.println(elm.getDocument().getText(
    s, e-s));
    } catch (Exception e) {
    System.out.println(e.getLocalizedMessage());
    return;
    System.out.println();
    for (int i = 0; i < elm.getElementCount(); i++) {
    dumpElement(elm.getElement(i), level+1);
    class OffsetTextArea extends JTextArea {
    int splitX = 0;
    int splitY = 0;
    public void setSplit(int x, int y) {
    splitX = x;
    splitY = y;
    public void paint(Graphics g) {
    g.translate(-splitX, -splitY);
    super.paint(g);
    g.translate( splitX, splitY);
    /* Corner.java is used by ScrollDemo.java. */
    class Corner extends JComponent {
    protected void paintComponent(Graphics g) {
    // Fill me with dirty brown/orange.
    g.setColor(new Color(230, 163, 4));
    g.fillRect(0, 0, getWidth(), getHeight());

  • Java.lang.Error in JTextArea

    I get a strange error while using JTextArea.append(String), more specifically, an error while trying to aquire writing lock. The error never show up at a precise time and sometimes just never show so I guess this is a multithread issue. However I already tried to synchronize on the text area, enqueue messages to print in a slave thread so that only one thread ever do the append, but nothing fix it.
    Does any of you already had this error or have any insight on a possible way to fix it?
    Regards

    No only one... puzzling, here is the code:
    import java.awt.Color;
    import java.awt.event.FocusListener;
    import java.awt.event.MouseWheelListener;
    import java.util.LinkedList;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    public class ConsolePane extends JScrollPane
         private static final int MAX_LINE = 120;
         private int max;
         private boolean follow;
         private JTextArea area;
         private ConsoleWriter writer;
         public ConsolePane()
              this(MAX_LINE);
         public ConsolePane(int max)
              if( max <= 0 )
                   throw new IllegalArgumentException("Null or negative max amount");
              this.max = max;
              area   = new JTextArea();
              writer = new ConsoleWriter();
              follow = false;
              area.setEditable(false);
              setViewportView(area);
              writer.start();
         public void addKeyListener(java.awt.event.KeyListener l)
              area.addKeyListener(l);
         public void addFocusListener(FocusListener l)
              super.addFocusListener(l);
              if( area != null )
                   area.addFocusListener(l);
         public void addMouseWheelListener(MouseWheelListener l)
              super.addMouseWheelListener(l);
              if( area != null )
                   area.addMouseWheelListener(l);
         protected void finalize()
              if( writer != null )
                   writer.kill();
         public boolean followLastLine()
              return follow;
         public int getMaxShownLines()
              return max;
         public String getSelectedText()
              return area.getSelectedText();
         public boolean isFocusOwner()
              return super.isFocusOwner() || area.isFocusOwner();
         public void print(String s)
              if( s == null )
                   s = "null";
              writer.enqueue(s);
         public void setBackground(Color bg)
              super.setBackground(bg);
              if( area != null )
                   area.setBackground(bg);
         public void setFollowLastLine(boolean f)
              follow = f;
              if( follow )
                   showLastLine();
                   repaint();
         public void setForeground(Color fg)
              super.setForeground(fg);
              if( area != null )
                   area.setForeground(fg);
         public void showLastLine()
              try{area.setCaretPosition(area.getLineStartOffset(area.getLineCount() - 1));
              }catch(Exception e){}
         public void setMaxShownLines(int max)
              if( max <= 0 )
                   throw new IllegalArgumentException("Null or negative max amount");
              else
                   this.max = max;
         private class ConsoleWriter extends Thread
              private boolean stop;
              private LinkedList pending;
               * Constructor for Writer.
              ConsoleWriter()
                   super("Console writer");          
                   stop = false;
                   pending = new LinkedList();
              void enqueue(String s)
                   if( s == null )
                        throw new IllegalArgumentException("Null string");
                   if( s.length() > 0 )
                        pending.addLast(s);
                        if( !isInterrupted() )
                             interrupt();
              void kill()
                   if( !stop )
                        stop = true;
                        if( !isInterrupted() )
                             interrupt();
              public void run()
                   while(!stop)
                        try{sleep(3600000);}catch(Exception e){}
                        while(pending.size() > 0)
                             write((String)pending.removeFirst());
                             yield();
              private void write(String s)
                   if( area.getText().length() == 0 && s.charAt(0) == '\n' )
                        area.append(s.substring(1));
                   else
                        area.append(s);
                   int excedent = area.getLineCount() - ConsolePane.this.max;
                   if( excedent > 0 )
                        try{JonsolePane.this.area.getDocument().remove(0, ConsolePane.this.area.getLineStartOffset(excedent));}catch(Throwable t){}
                   if( ConsolePane.this.followLastLine() )
                        ConsolePane.this.showLastLine();
                   interrupted();
    }

Maybe you are looking for

  • Error when creating a new user

    Hi all When I try to create a new user I'm getting an error message Unknown message (ID = LOWERCASE_REQUIRED) I entered all the required fields in the way it was defined and still I get this error. I never had this problem before. Can anyone please h

  • Printing format control in ALV TREE

    Hello there, I searched all over SDN but I couldn't find a solution for my problem ! It would be nice of you if you can help me sort it out. I'm using an ALV TREE : DATA: gv_tree             TYPE REF TO cl_gui_alv_tree   CALL METHOD gv_tree->set_tabl

  • Good Choice for a "user" Selector ? (more inside)

    for a chat applikation i have reserved the left part of a borderlayout for a tabbed pane. one tab shall display a matrix if icons, each representing a user (include a name string). now im thinking about which component to choose to realize that. it i

  • Translation of adopeforms used in webdynpro ABAP

    Hi Experts, I'm using adopeform th'gh webdynpro application. I need to output the form in french language. how can it be done??. I have already tested with se63 transaction but its not getting translated in the webpage . Kindly give a solution. Kindl

  • Usb 3.0 driver for windows 7

    my usb 3.0 is not working i need the driver