AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PopUp TableCellEditor?

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java GUI Toolkits
View previous topic :: View next topic  
Author Message
Ian Wilson
Guest





PostPosted: Wed Aug 23, 2006 9:01 pm    Post subject: PopUp TableCellEditor? Reply with 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?
Back to top
Rogan Dawes
Guest





PostPosted: Mon Aug 28, 2006 2:46 pm    Post subject: Re: PopUp TableCellEditor? Reply with quote



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





PostPosted: Thu Aug 31, 2006 2:46 pm    Post subject: Re: PopUp TableCellEditor? Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java GUI Toolkits All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.