JTable viewport

P

Peter

Hi
I have a JTable with many rows and columns, I have a JDialog which
size is 100,100.
I want to take (0,0)-(50,100) and (700,0)-(750,100) from JTable and
put them together into a "whatever control" which on a JDialog.

Possible?

thanks
from Peter ([email protected])
 
P

Paul Lutus

Peter said:
Hi
I have a JTable with many rows and columns, I have a JDialog which
size is 100,100.

100,100 what? Furlongs? Pixels? Character widths? Table cells?
I want to take (0,0)-(50,100) and (700,0)-(750,100) from JTable and
put them together into a "whatever control" which on a JDialog.

Try posting more words. Do you want a partial view of your table in a
window, or do you want to sequester some of the table cells, or what?

Have you considered putting your table into a JScrollPane?
 
P

Peter

sorry about the mistake.
I want to cut the (0,0)-(50,100) and (700,0)-(750,100) pixels of a
JTable, and put them together into a new JEditorPane or JPanel or
whatever. Is this possible?

thanks
from Peter ([email protected])
 
P

Paul Lutus

Peter said:
sorry about the mistake.
I want to cut the (0,0)-(50,100) and (700,0)-(750,100) pixels of a
JTable, and put them together into a new JEditorPane or JPanel or
whatever. Is this possible?

Why do you think the raw pixels from the original image will be suitable for
insertion into a new table? What is the point?

Instead of describing your solution to an unstated problem, Why ... don't
.... you ... tell ... us ... what ... you ... are ... trying ... to ... do?
 
M

Mladen Adamovic

Peter said:
I want to cut the (0,0)-(50,100) and (700,0)-(750,100) pixels of a
JTable, and put them together into a new JEditorPane or JPanel or
whatever. Is this possible?

Yes. I think you can do it making class MyTable extends JTable in which
change the paint()
method to collect data you need.
 
P

Peter

Thanks for reply
I have a JTable, i want the first column show forever, even scroll
the horizontal bar.
When scroll the horizontal bar, the first column never disappear,
but the rest column scroll as normal, is this possible?

thanks
from Peter ([email protected])
 
M

Mladen Adamovic

Peter said:
When scroll the horizontal bar, the first column never disappear,
but the rest column scroll as normal, is this possible?

You can make TWO JTables, in the first one you put just
first column, and the rest of columns in second JTable (which you make
scrollable).

Or I think that there exists some rowHeader solution, which will satisfy
your needs. Check "rowHeader" on java.sun.com.
 
D

David Postill

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

18:23:09 -0700, (e-mail address removed) (Peter)
wrote:

| Thanks for reply
| I have a JTable, i want the first column show forever, even scroll
| the horizontal bar.
| When scroll the horizontal bar, the first column never disappear,
| but the rest column scroll as normal, is this possible?

[[http://www.codeguru.com/java/articles/128.shtml][Fixed Columns]] Row header

<davidp />

- --
David Postill

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0.2 - not licensed for commercial use: www.pgp.com
Comment: Get key from pgpkeys.mit.edu:11370

iQA/AwUBP5UJvHxp7q1nhFwUEQIx2QCg6QamL/Z4kocGGnyCwcq08Qiea3IAoOaN
JIWBukwoXDJDeepPfM7EeyWq
=TLy3
-----END PGP SIGNATURE-----
 
D

David Postill

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

18:23:09 -0700, (e-mail address removed) (Peter)
wrote:

| Thanks for reply
| I have a JTable, i want the first column show forever, even scroll
| the horizontal bar.
| When scroll the horizontal bar, the first column never disappear,
| but the rest column scroll as normal, is this possible?

[[http://www.codeguru.com/java/articles/128.shtml][Fixed Columns]] Row header

<davidp />

- --
David Postill

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0.2 - not licensed for commercial use: www.pgp.com
Comment: Get key from pgpkeys.mit.edu:11370

iQA/AwUBP5UJvHxp7q1nhFwUEQIx2QCg6QamL/Z4kocGGnyCwcq08Qiea3IAoOaN
JIWBukwoXDJDeepPfM7EeyWq
=TLy3
-----END PGP SIGNATURE-----
<davidp />
 
P

Peter

Mladen Adamovic said:
You can make TWO JTables, in the first one you put just
first column, and the rest of columns in second JTable (which you make
scrollable).

Or I think that there exists some rowHeader solution, which will satisfy
your needs. Check "rowHeader" on java.sun.com.

Thanks for your advise first.
But i tried this solution before, that case two problems.
1) When i selected the first table, the second table need to be
selected also. There will have a time delay if do it in programming.

2) Sychorized scroll two tables have worst performance in Java.

thanks for reply
from Peter ([email protected])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top