Results 1 to 4 of 4
  1. #1
    bachtoutou is offline Member
    Join Date
    May 2008
    Posts
    11
    Rep Power
    0

    Default how to post a long text in an editor

    Hello,

    I have a long text in a cell of a table and it is not posted in entier.I must to make pass the cursor to see the totality of the text. I want to post the totality of the text in an editor when I click on the cell.

    Is that it possible????

  2. #2
    chaster is offline Member
    Join Date
    Mar 2008
    Posts
    6
    Rep Power
    0

    Default

    Yes, it is.
    Use:
    Java Code:
    int selectedRow = table.getSelectedRow();
    Then u can write:
    Java Code:
                if (selectedRow>=0)
                    something.append((String)table.getValueAt(selectedRow, 0));
    Assumung that the long text is at column 0, and something is a text area...

  3. #3
    bachtoutou is offline Member
    Join Date
    May 2008
    Posts
    11
    Rep Power
    0

    Default

    Thank you for your reply.I have created an event when i clik on the table :

    private JTable jTable1 = new JTable();
    private JTextArea ss=new JTextArea();
    private void jTable1_mouseClicked(MouseEvent e) {
    int selectedRow = jTable1.getSelectedRow();
    if (selectedRow>=0)
    ss.append((String)jTable1.getValueAt(selectedRow, 0));
    ss.setVisible(true);
    }
    But it dosen't work.Can you explain me more how can i do??

    Thank you a lot
    Last edited by bachtoutou; 06-05-2008 at 06:04 PM. Reason: I forgot to ask something

  4. #4
    bachtoutou is offline Member
    Join Date
    May 2008
    Posts
    11
    Rep Power
    0

    Default

    hello,
    I have tried this code and it works.the only problem is that i get only the first line of the table and then it dosen't change even i change the selected row.
    Java Code:
        private void jTable1_mouseClicked(MouseEvent e) {
    int selectedRow = jTable1.getSelectedRow();
            frame.add(jTextArea1, BorderLayout.CENTER);
                frame.setSize(300, 150);
               frame.setLocation(500,400);  
     if (selectedRow>=0){
               jTextArea1.append((String)jTable1.getValueAt(selectedRow, 1));
               jTextArea1.setVisible(true);
               frame.setVisible(true);
               
       
     }
        
        }

Similar Threads

  1. It takes very long time.....
    By iresha in forum Advanced Java
    Replies: 6
    Last Post: 05-11-2008, 03:31 AM
  2. Problem in Text Editor
    By mustahsan4u in forum New To Java
    Replies: 2
    Last Post: 03-26-2008, 03:34 PM
  3. Replies: 1
    Last Post: 08-07-2007, 08:53 AM
  4. SOAP over HTTP/POST
    By sabatier in forum NetBeans
    Replies: 0
    Last Post: 07-10-2007, 09:04 AM
  5. Error: convert from String to long
    By bbq in forum New To Java
    Replies: 1
    Last Post: 06-29-2007, 08:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •