Questions tagged [tablecellrenderer]

TableCellRenderer is a Java Swing interface that defines the method required by any object that would like to be a renderer for cells in a JTable.

TableCellRenderer is a Java Swing interface that defines the method required by any object that would like to be a renderer for cells in a JTable.

472 questions
0
votes
0 answers

How to render all the cell in one specific column in JTable that all commas in the number or label be under each other?

I want all commas in the cell in one specific column in JTable be under each other like example below. Does anyone know what should i change in my render? 1000,00 0,12 12,14 888,01 45,123 1458,11 Code: TableColumn columnPrice =…
itro
  • 7,006
  • 27
  • 78
  • 121
0
votes
0 answers

Common generic type for JTextField and JComboBox

I want to create a dynamic table based on number of columns and datatype. The problem is that when I want to get element from JTextField and JComboBox generic type list. I have to iterate from different generic type, but adding into one generic type…
Mohammod Hossain
  • 4,134
  • 2
  • 26
  • 37
0
votes
1 answer

how to use DefaultCellEditor to make column of the JTable to get only numbers and round them with two signs after dot?

I am not sure if this is the right way to do this but I think so. I have tried to use DecimalFormat but I cant understand it. Can someone help me? Is this the correct way to do this DefaultCellEditor + DecimalFormat?
user1761818
  • 365
  • 1
  • 7
  • 14
0
votes
3 answers

How to color specific rows in a JTable

I want the ability to highlight some rows of JTable, depending on the values in the row itself. For example, if the existing qty < reorder level, that row should be highlighted in the JTable. I know there is a table method…
chathura
  • 3,362
  • 6
  • 41
  • 68
0
votes
2 answers

Can we retrieve cell of JTable as a JComponent?

Just want to know can we retrieve cell of JTable as a JComponent and can we calculate the area of each cell of jtable so that i can bound to the user to click on that particular area.
Java_Alert
  • 1,159
  • 6
  • 24
  • 50
0
votes
2 answers

getTableCellRendererComponent not called after a fire event sent from keyTyped

Hi have a Jtable with a specific cell rendered model for one column. This model, just put buttons in this column instead of text data. The first display of the table works well. WHen I'm using a function that change the order of the content, the…
user1235648
0
votes
1 answer

FEST: Retrieving a cell value when cell is under a JTable with CellRenderPane

I have code like this: //(...) JTableFixture myTreeTable = frame.table(matcher); If I try to obtain JCellFixtures or values or contents, everything is null. I am only obtaining the number of rows or columns. JTable internally uses a…
Whimusical
  • 6,401
  • 11
  • 62
  • 105
0
votes
1 answer

Dynamically colouring jTable row

In the answer to my previous question, Coloring jTable row, but now I'm unsure as to new question goes here, setting color to row is working. But I want to give it from a for loop, means I want to set color for i'th row. I'm giving the which I have…
Luna
  • 956
  • 4
  • 15
  • 28
0
votes
1 answer

Custom Cell Render JXtreetable

this is my first post, I'm actually implementing JXtreetable component, which I have managed to display all the data contained in it, but I want to create a custom cell rendering in order to display parent's row different with their child (i.e make…
Roufiq
  • 21
  • 3
0
votes
2 answers

Accepting Focus on a JTextField and JTextArea in a Table

I have a three-column JTable: an uneditable JTextField, an editable JTextArea, and an editable JTextField. My problem is twofold. I'd like the last two columns to be background-highlighted and ready to edit, with a visible cursor, when I tab into…
Elly
  • 63
  • 8
0
votes
2 answers

in JTable remove space between images

In the picture below you see a JTable with two columns. UPDATE **The columns are hidden. The red behind the selected row is background color red only for demonstration purpose. ** Each row have two pictures. First picture is a png image…
Erik
  • 5,039
  • 10
  • 63
  • 119
0
votes
2 answers

change cell color does not work on netbeans

I created desktop application with Netbeans, and I want to change a particular cell color if it has string value of "on Process". I tried class CustomTableCellRenderer extends DefaultTableCellRenderer{ public Component…
Jamol
  • 3,768
  • 8
  • 45
  • 68
0
votes
2 answers

Implements a custom CellEditor for a JTable with 2 columns (String, Integer) and n Rows

I have a JTable with N rows and 2 columns I need to implement a custom CellEditor class to access the data input of each cell with table.getCellEditor(int row, int column).getCellEditorValue() I have used this CellEditor class class MyEditor…
AndreaF
  • 11,975
  • 27
  • 102
  • 168
-1
votes
1 answer

How to sort dates in a column in a JTable?

I have the following jtable jtable image I get the information from a database and everything is saved as string in the table, I just want to sort the second column "Fecha de recepcion" which has dates in the format dd-mm-yyyy, I used a row…
Gaaperk
  • 3
  • 4
-1
votes
1 answer

Cannot align in a cell the text on the left and Icon on the right

I am trying to achieve a very simple thing, I tried different options but none seems to work. I have a simple JTable, in a column I use JLabel in order to show the text and the icon. I just want to have the text to be on the left of the cell and the…