Meaningless Drivel is fun!*
The moose likes Swing / AWT / SWT and the fly likes JTable row Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable row" Watch "JTable row" New topic
Author

JTable row

supriya acharya
Greenhorn

Joined: Jan 26, 2009
Posts: 28
hello

I am using JTable to display contents..when i am selecting any row is it possible to automatically scroll the contents so that user can read full contents..
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

No, if there are more rows than can fit on the screen, clearly no amount of scrolling will make them all visible at the same time.

Or when you said "the contents" did you just mean the contents of the selected row, and not the contents of the table? Again, if there are more columns than can fit on the screen, clearly no amount of scrolling will make them all visible at the same time.
supriya acharya
Greenhorn

Joined: Jan 26, 2009
Posts: 28
i mean to scroll contents of the selected row and selected column only say i have 2nd column in which i have one big line but on the screen it is not fully visible so when i am selecting that cell(row) is it possible to scroll it automatically?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10175
    
    8

Check out JTable#getCellRect() and JComponent#scrollRectToVisible().
Using these two you can achieve the desired effect.
I presume your column width is sufficient enough to display the big line.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTable row
 
Similar Threads
JTable
JTable
JTable
JTable
Jtable