Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #4909
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail |
|---|---|
| From | Novice <novice@example..com> |
| Newsgroups | comp.lang.java.gui |
| Subject | Re: Forcing cell edits in a JTable? |
| Date | Fri, 6 Jan 2012 14:16:29 +0000 (UTC) |
| Organization | Your Company |
| Lines | 40 |
| Message-ID | <Xns9FD25E793CF3Ejpnasty@94.75.214.39> (permalink) |
| References | <Xns9FD1EF35A670Djpnasty@94.75.214.39> <je6mi4$j66$1@dont-email.me> |
| NNTP-Posting-Host | 5PPmjkvSSHvzZTySRz75XA.user.speranza.aioe.org |
| X-Complaints-To | abuse@aioe.org |
| User-Agent | Xnews/5.04.25 |
| X-Antivirus-Status | Clean |
| X-Notice | Filtered by postfilter v. 0.8.2 |
| X-Antivirus | avast! (VPS 120106-0, 2012-01-06), Outbound message |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.gui:4909 |
Show key headers only | View raw
Jeff Higgins <jeff@invalid.invalid> wrote in news:je6mi4$j66$1@dont-email.me: > On 01/05/2012 11:30 PM, Novice wrote: >> I'm looking for some advice on the best way to handle a situation in >> a program. >> >> I am displaying a JTable and giving the user the option to add new >> rows to the table. When the user chooses to insert a row, I create a >> new empty row in the table at the desired place via a custom-written >> insertRow() method in the table model. Then I execute >> fireTableRowsInserted() and the empty row appears. All that works >> fine. >> >> But I don't want to leave the new row empty, I want to force the user >> to populate each cell in the new row. Almost anything goes for these >> cells but each value will have to pass at least one check in that >> column's cell renderer, namely that it is not blank. >> >> What's the best way to ensure that the new row gets populated before >> the user moves on to edit, delete, or insert another row? > > I'm really not trying to be obnoxious here, but can you just pop up a > dialog that states, "If you'll fill out these values correctly, I will > add them to the Table for you". I could do that. In fact, that's how I was doing it in the old version of the program and it worked fine. I even had similar dialogs for both updating a row and deleting it. But someone suggested that I avoid using extra dialogs to do this kind of thing and just do all of it right in the table so I'm trying to do that now. I have update and delete working fine but am struggling a bit with insert. I may ultimately go back to using an insert dialog - although I think I'll leave update and delete so that both are done directly from the table - but I'd like to see if I can get the insert to work within the table. But I'm having trouble forcing the new cells to be edited in turn. -- Novice
Back to comp.lang.java.gui | Previous | Next — Previous in thread | Next in thread | Find similar
Forcing cell edits in a JTable? Novice <novice@example..com> - 2012-01-06 04:30 +0000
Re: Forcing cell edits in a JTable? Jeff Higgins <jeff@invalid.invalid> - 2012-01-06 06:46 -0500
Re: Forcing cell edits in a JTable? Jeff Higgins <jeff@invalid.invalid> - 2012-01-06 07:01 -0500
Re: Forcing cell edits in a JTable? Novice <novice@example..com> - 2012-01-06 14:17 +0000
Re: Forcing cell edits in a JTable? Novice <novice@example..com> - 2012-01-06 14:16 +0000
Re: Forcing cell edits in a JTable? Jeff Higgins <jeff@invalid.invalid> - 2012-01-06 11:48 -0500
Re: Forcing cell edits in a JTable? Jeff Higgins <jeff@invalid.invalid> - 2012-01-06 15:13 -0500
Re: Forcing cell edits in a JTable? Jeff Higgins <jeff@invalid.invalid> - 2012-01-06 07:22 -0500
Re: Forcing cell edits in a JTable? Novice <novice@example..com> - 2012-01-06 14:19 +0000
csiph-web