 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ian Wilson Guest
|
Posted: Wed Aug 23, 2006 9:01 pm Post subject: PopUp TableCellEditor? |
|
|
First an apology, in a previous post I committed the Usenet sin of
asking "How do I do X" when I really wanted to know "How do I do Y" - I
thought that doing X was the way to achieve Y.
I have a JTable displayed in the usual way. One of the editable columns
contains short codes. This is for brevity, to conserve space. So the
codes are shown in a narrow column.
However I wanted the table cell editor to allow the user to pick from a
list of the long names for these codes. I think this would help people
who are not familiar with the short codes.
For the TableCellEditor I tried using a JComboBox that shows the names
instead of the codes. It became obvious that the JComboBox width is
constrained by the table column width and so is normally not wide enough
to show the long names.
So - is there some other widget I can use in conjunction with a JTable
for this?
Would it be wiser to have a normal editor for the short codes but have
available some method (e.g. a keyboard shortcut) that will popup some
more elaborate "chooser" JDialog of my own devising? |
|
| Back to top |
|
 |
Rogan Dawes Guest
|
Posted: Mon Aug 28, 2006 2:46 pm Post subject: Re: PopUp TableCellEditor? |
|
|
Ian Wilson wrote:
| Quote: | First an apology, in a previous post I committed the Usenet sin of
asking "How do I do X" when I really wanted to know "How do I do Y" - I
thought that doing X was the way to achieve Y.
I have a JTable displayed in the usual way. One of the editable columns
contains short codes. This is for brevity, to conserve space. So the
codes are shown in a narrow column.
However I wanted the table cell editor to allow the user to pick from a
list of the long names for these codes. I think this would help people
who are not familiar with the short codes.
For the TableCellEditor I tried using a JComboBox that shows the names
instead of the codes. It became obvious that the JComboBox width is
constrained by the table column width and so is normally not wide enough
to show the long names.
So - is there some other widget I can use in conjunction with a JTable
for this?
Would it be wiser to have a normal editor for the short codes but have
available some method (e.g. a keyboard shortcut) that will popup some
more elaborate "chooser" JDialog of my own devising?
|
Take a look for the TAME swing examples. You'll find one showing how you
can have a popup editor that is wider than the column width.
Rogan |
|
| Back to top |
|
 |
Ian Wilson Guest
|
Posted: Thu Aug 31, 2006 2:46 pm Post subject: Re: PopUp TableCellEditor? |
|
|
Rogan Dawes wrote:
| Quote: | Ian Wilson wrote:
First an apology, in a previous post I committed the Usenet sin of
asking "How do I do X" when I really wanted to know "How do I do Y" -
I thought that doing X was the way to achieve Y.
I have a JTable displayed in the usual way. One of the editable
columns contains short codes. This is for brevity, to conserve space.
So the codes are shown in a narrow column.
However I wanted the table cell editor to allow the user to pick from
a list of the long names for these codes. I think this would help
people who are not familiar with the short codes.
For the TableCellEditor I tried using a JComboBox that shows the names
instead of the codes. It became obvious that the JComboBox width is
constrained by the table column width and so is normally not wide
enough to show the long names.
So - is there some other widget I can use in conjunction with a JTable
for this?
Would it be wiser to have a normal editor for the short codes but have
available some method (e.g. a keyboard shortcut) that will popup some
more elaborate "chooser" JDialog of my own devising?
Take a look for the TAME swing examples. You'll find one showing how you
can have a popup editor that is wider than the column width.
|
Thanks, their SteppedComboBox does exactly what I wanted. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|