Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-05-2008, 06:40 PM
Member
 
Join Date: May 2008
Posts: 11
bachtoutou is on a distinguished road
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????
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-05-2008, 06:46 PM
Member
 
Join Date: Mar 2008
Posts: 6
chaster is on a distinguished road
Yes, it is.
Use:
Code:
int selectedRow = table.getSelectedRow();
Then u can write:
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...
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 06-05-2008, 07:03 PM
Member
 
Join Date: May 2008
Posts: 11
bachtoutou is on a distinguished road
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 07:04 PM. Reason: I forgot to ask something
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 06-06-2008, 04:00 AM
Member
 
Join Date: May 2008
Posts: 11
bachtoutou is on a distinguished road
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.
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); } }
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
It takes very long time..... iresha Advanced Java 6 05-11-2008 04:31 AM
Problem in Text Editor mustahsan4u New To Java 2 03-26-2008 04:34 PM
Error: Cannot access protected member long getTimeInMillis() in class Calendar cachi Advanced Java 1 08-07-2007 09:53 AM
SOAP over HTTP/POST sabatier NetBeans 0 07-10-2007 10:04 AM
Error: convert from String to long bbq New To Java 1 06-29-2007 09:23 PM


All times are GMT +3. The time now is 01:43 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org