Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #5010

Re: JTable with TableCellEditor ???

From "John B. Matthews" <nospam@nospam.invalid>
Newsgroups comp.lang.java.gui
Subject Re: JTable with TableCellEditor ???
Date 2012-02-14 07:02 -0500
Organization The Wasteland
Message-ID <nospam-292EF9.07024214022012@news.aioe.org> (permalink)
References <2de12f28-184b-451e-bf17-c32ba0b716f9@f5g2000yqm.googlegroups.com> <jhca06$qsq$1@dont-email.me>

Show all headers | View raw


In article <jhca06$qsq$1@dont-email.me>,
 Jeff Higgins <jeff@invalid.invalid> wrote:

> On 02/13/2012 06:02 PM, The Nigga wrote:
> >
> > I have a JTable and I created a table cell editor for that can use 
> > a JTextField customized, this is working. Now I need that when I 
> > press enter in cell selected the edit is open in JTable and not 
> > change the row before change.
> >
> > The situation looks like below Enter on Selected Cell -->  open the 
> > edit (enter value = US$ 1.00) --> press enter again, close the edit 
> > and request focus in next cell to make the process again.
> >
> This example may help.
>
> <http://www.javalobby.org/articles/jtable/>

OP: I'm still a little vague on the desired behavior. To change the 
behavior of the enter key, you'll probably need to change its key 
binding, as suggested in this short article [1]. You may also want to 
look at setCellSelectionEnabled() [2].

[1] <http://stackoverflow.com/a/9095442/230513>
[2] <http://docs.oracle.com/javase/tutorial/uiswing/components/table.html>

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Find similar


Thread

JTable with TableCellEditor ??? The Nigga <fernandopaivabr@gmail.com> - 2012-02-13 15:02 -0800
  Re: JTable with TableCellEditor ??? Jeff Higgins <jeff@invalid.invalid> - 2012-02-13 19:30 -0500
    Re: JTable with TableCellEditor ??? "John B. Matthews" <nospam@nospam.invalid> - 2012-02-14 07:02 -0500

csiph-web