|
|
JTable with row selection, but no cell selection
I have a JTable where I want the user to be able to select a row, but not a
single cell. If the user clicks on a cell, the entire row should be
highlighted (=different background color), but the CellEditor shouldn't come
up.
JTable table = new JTable();
// this wil disable cell selection, but also the row
// highlighting disappears
table.setCellSelectionEnabled(false);
Thanks
Simon
|
|
0
|
|
|
|
Reply
|
Simon
|
1/4/2005 7:48:59 PM |
|
>I have a JTable where I want the user to be able to select a row, but not a
> single cell. If the user clicks on a cell, the entire row should be
> highlighted (=different background color), but the CellEditor shouldn't
> come
> up.
>
> JTable table = new JTable();
>
> // this wil disable cell selection, but also the row
> // highlighting disappears
> table.setCellSelectionEnabled(false);
table.setRowSelectionAllowed(true);
--
Andrey Kuznetsov
http://uio.dev.java.net Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities
|
|
0
|
|
|
|
Reply
|
Andrey
|
1/5/2005 3:35:41 AM
|
|
Followup-To: comp.lang.java.gui.
Simon Niederberger <simon@sincore.ch> wrote:
> I have a JTable where I want the user to be able to select a row, but not a
> single cell. If the user clicks on a cell, the entire row should be
> highlighted (=different background color), but the CellEditor shouldn't come
> up.
You a) change the renderer not to paint editable cells in a special
background color and b) configure the editor not to start editing
on single mouse clicks.
Christian
|
|
0
|
|
|
|
Reply
|
usenet
|
1/7/2005 4:17:40 PM
|
|
|
2 Replies
587 Views
(page loaded in 0.035 seconds)
Similiar Articles: JTable with row selection, but no cell selection - comp.lang.java ...I have a JTable where I want the user to be able to select a row, but not a single cell. If the user clicks on a cell, the entire row should be highli... row-wise selection in a uitable - comp.soft-sys.matlab... on the non-contiguous cell selection property of the Java object, selecting rows in the uitable no ... mtable.getTable; row = jtable ... can you get the selected row or ... JTable row selection (left and right mouse) - comp.lang.java.gui ...JTable with row selection, but no cell selection - comp ... ... How to center or right justify JTable column data ... How To Loop Through Looking For Selected Rows ... Disable a JTable row - comp.lang.java.guiJTable with row selection, but no cell selection - comp.lang.java ... Disable a JTable row - comp.lang.java.gui Custom tooltip renderer in JTable - comp.lang.java.gui ... JTable horizontal scrollbar problem - comp.lang.java.gui ...Selecting a row in a JTable - comp.lang.java.gui JTable horizontal scrollbar problem - comp.lang.java.gui ... JTable with row selection, but no cell selection - comp.lang ... Custom tooltip renderer in JTable - comp.lang.java.guiSelecting a row in a JTable - comp.lang.java.gui Custom tooltip renderer in JTable - comp.lang.java.gui JTable with row selection, but no cell selection - comp.lang.java ... JTree and JList and models - comp.lang.java.gui... change my JTree, according to element that has been selected in a JList. ... ... JTable with row selection, but no cell selection - comp.lang.java ... JTree and JList and models ... Cell focus in JTable - avoid focus on non-editable cells? - comp ...In single selection mode, which I presume you are using, the selected cell is identified by the selected row and column in the ... How to set Caret in JTable Cell ... programatically select cells in uitable - comp.soft-sys.matlab ...... user has selected with the mouse jtable ... Using jtable.changeSelection() does work but that only selects one cell at a ... Disable a JTable row - comp.lang.java.gui selection ... JTable, edit a cell, but changed value not seen - comp.lang.java ...I have a problem with using JTable, editing a cell in a row and then expecting that ... I have an issue where the last cell in a selected row is edited and then the ... JTable with row selection, but no cell selection - comp.lang.java ...I have a JTable where I want the user to be able to select a row, but not a single cell. If the user clicks on a cell, the entire row should be highli... Getting the Selected Cells in a JTable Component | Example DepotThe method for determining the selected cells depends on whether column, row, or cell selection is enabled. 7/23/2012 8:52:05 AM
|
|
|
|
|
|
|
|
|