Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

JTable Cell Editing


  • From: dholland@xxxxxxxxxxxxxxxxx (David Holland)
  • Subject: JTable Cell Editing
  • Date: Thu, 30 Sep 1999 10:35:41 -0600

	I appreciate the info, but I discovered the clickCountToStart method
yesturday afternoon, but I am still not getting the results I need.
(probably because I didn't state them clearly!)  so I will try to state my
need clearer

	I have a JTable with cells that initially contain a double value of
0.0   what I wish to do, is to be able to just select the table cell, and
have the 0.0 be hi-lighted (maybe the terminology is selected) so that I can
then type a new value, say 3 and it will stomp on the 0.0    Presently, I
have to double click on the cell, to have the 0.0 selected for being stomped
on.  Is it possible to do this?  If I use the clickCountToStart method, then
the editor is active when I select the cell, but I still have to hit
backspace, to delete the 0.0 first, or I would end up with 0.03 instead of
3.   (I hope I explained myself clearly this time!, but am still grateful
for the earlier help Carlo)

> -----Original Message-----
> From:	cvandeso@xxxxxxxx [SMTP:cvandeso@xxxxxxxx]
> Sent:	Thursday, September 30, 1999 2:22 AM
> To:	advanced-java@xxxxxxxxxxxxxxxx
> Cc:	David Holland
> Subject:	Re: JTable Cell Editing
> 
> 
> 
> 
> 
> Hi David,
> 
> You can use this method in your CellEditor :
> 
>   /**
>    *  clickCountToStart controls the number of clicks required to start
>    *  editing if the event passed to isCellEditable() or
> startCellEditing()
> is
>    *  a MouseEvent.  For example, by default the clickCountToStart for
>    *  a JTextField is set to 2, so in a JTable the user will need to
>    *  double click to begin editing a cell.
>    *  @return the number of clicks needed to start editing
>    */
> //------------------------------------------------------------------------
> -
> ------------------
>   public int getClickCountToStart() {
> //------------------------------------------------------------------------
> -
> ------------------
>     return clickCountToStart;
>   }
> 
> Cheers,
> Carlo.
> 
> Consulting Engineer.
> 
> 
> 
> 
> 
> David Holland <dholland@xxxxxxxxxxxxxxxxx> on 29/09/99 21:36:34
> 
> To:   advanced-java@xxxxxxxxxxxxxxxx
> cc:    (bcc: Carlo Van de Sompel/ISD/Anhyp/BE)
> Subject:  JTable Cell Editing
> 
> 
> 
> 
> 
>      Does anybody know how to get a cell to be in edit mode ( for a
> JTable ) just by selecting it?  At present, you have to double click on
> the
> cell to hi-lite what is in the cell for editing.  We just want to select
> the
> cell, not double click it.  I am using 1.1.7  (VisualAge version 2.0).
> Any
> help would be greatly appreciated.
> (I hope this is the correct forum for this question)
> David Holland
> D.M.A.
> > efa Software Services Ltd.
> 858, 605 5th Ave S.W.
> Calgary, Alberta
> T2P 3H5
> 
> ---
> To unsubscribe, mail advanced-java-unsubscribe@xxxxxxxxxxxxxxxx
> To get help, mail advanced-java-help@xxxxxxxxxxxxxxxx
> 
> 
> 

---
To unsubscribe, mail advanced-java-unsubscribe@xxxxxxxxxxxxxxxx
To get help, mail advanced-java-help@xxxxxxxxxxxxxxxx