[Logo]
Forums Register Login
jtable rendering problem
Hi,
I have problem in displaying the default AND values in the combo boxes in the table.

The table in its empty state, that is when it is contructed and before
the user has a chance to make any changes, a row with no data and 2 columns is created.

The table looks like:

(empty)|(empty)

When the user hits the button once, the new row is added at position
0 in the table and the row that was created first without the user
hitting the button moves down.
Now the table looks like :

(empty)|(some value)
(empty)|(empty)

When the user hits the button the second time, the new row
is added at the last but one row and the table looks like :

(empty)|(some value)
AND|(some value)
(empty)|(empty)

When the user hits the button the third time,the new row
is added at the last but one row and the table looks like :

(empty)|(some value)
AND|(some value)
AND|(some value)
(empty)|(empty)

When the user hits the button the fourth time,the new row
is added at the last but one row and the table looks like :

(empty)|(some value)
AND|(some value)
AND|(some value)
AND|(some value)
(empty)|(empty)

Addtional rows can be added thus expanding the table.

Thanks in advance for any help.

Sample code is as below that needs changes as per the requirement:


[ September 21, 2006: Message edited by: seema prakash ]
[ September 21, 2006: Message edited by: seema prakash ]
needs changes as per the requirement
Could you please state the requirement.
Hi,
Thanks for the concern. The requirement is as stated below:

The table in its empty state, that is when it is contructed and before
the user has a chance to make any changes, a row with no data and 2 columns should be created.

The table looks like:

(empty)|(empty)

When the user hits the button once, the new row is added at position
0 in the table and the row that was created first without the user
hitting the button moves down.
Now the table looks like :

(empty)|(some value)
(empty)|(empty)

When the user hits the button the second time, the new row
is added at the last but one row and the table looks like :

(empty)|(some value)
AND|(some value)
(empty)|(empty)

When the user hits the button the third time,the new row
is added at the last but one row and the table looks like :

(empty)|(some value)
AND|(some value)
AND|(some value)
(empty)|(empty)

When the user hits the button the fourth time,the new row
is added at the last but one row and the table looks like :

(empty)|(some value)
AND|(some value)
AND|(some value)
AND|(some value)
(empty)|(empty)

Addtional rows can be added thus expanding the table.

Thanks.
Sorry, I was confused. When I run your app it seems to behave just like your requirement: the blank row remains at the bottom of the JTable and each newly–added row appears just above it. After pressing the button three times your JTable looks like this:

The fourth press hides the blank/last row and brings up the vertical scrollbar.
Thanks for the reply. It displays the same way as you have said. But, I want it to be displayed as below with cell(0,0) = empty
cell(1...,0) = AND



[ September 22, 2006: Message edited by: seema prakash ]

[ September 22, 2006: Message edited by: seema prakash ]

[ September 22, 2006: Message edited by: seema prakash ]
[ September 22, 2006: Message edited by: seema prakash ]
Let's see if this does what you want.
Thanks a lot!! It works as desired.
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards


This thread has been viewed 1186 times.

All times above are in ranch (not your local) time.
The current ranch time is
May 26, 2018 02:00:28.