The Artima Developer Community
Sponsored Link

Java Answers Forum
Table still does not get updated--- fixed. But got another problem?

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Sam Li

Posts: 5
Nickname: sam2004
Registered: Jun, 2004

Table still does not get updated--- fixed. But got another problem? Posted: Jun 29, 2004 5:20 AM
Reply to this message Reply
Advertisement
Hello,
First of all, a big thanks to all those people replied to my topic, I really appreaciate it. You guys are really helpful.

Now I would like to ask another question. My table is a 4 rows x 2 columns table, and I need to place a very long string into every cell of the second column, so I can not display all the data completely in the second column and got "..." near the right hand side vertical border(I think that means the rest of the data). I trie to use myTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF),but I have to adjust the width of the second column to get the horizontal bar. The trouble is I have to expand the width a bit to get a bit data to display, then expand the width a bit more to get a bit more data, it seems troublesome. It would be better to get a horizontal bar to scroll through the second column completely just by moving the bar, but I do not knwo how to do it. Could anyone tell me how to do it? I tried to add a scrollbar to the panel in which my table is in, but it only scrolls through the panel, not my table.
For example:

JScrollPane sp = new JScrollPane();
JScrollBar jb = new JScrollBar(JScrollBar.HORIZONTAL);

sp.getViewport().add (myTable);

//sp.setViewportView(myTable);
lower_panel.add (sp, "Center");
lower_panel.add (jb, "South");

Thank you for any comments.

Sam

Topic: Random Number generator question. Previous Topic   Next Topic Topic: Socket Prog

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use