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
5
votes
1 answer

Reduce number of getTableCellRendererComponent calls

I am using a custom cell renderer that implements TableCellRenderer and displays JTextArea (instead of JLabel) for each row. I am basically overriding getTableCellRendererComponent(...) method with mine which does some additional calculations per…
4
votes
1 answer

Multiline JTable Cells with auto height- extra large first row

I am developing a Java Desktop Application (jdk1.6) with Swing. My problem is about Multi-line cells(text-wrapping) with auto-adjusting cell height property in JTable. I could already implement this structure in this way: Table has its own…
isilpekel
  • 121
  • 1
  • 8
4
votes
2 answers

Java: Override table cell renderer, but with default background and properties

If you want to add a custom renderer, normally, you'd either extend some JComponent (like JLabel) and implement TableCellRenderer, or you'd extend DefaultTableCellRenderer. However, in either case, what I find is that the cell style is completely…
Timothy Miller
  • 1,527
  • 4
  • 28
  • 48
4
votes
2 answers

JTable custom cell renderer focus problem

I have a table like this. The second column uses a JTextField renderer and the third column uses a JPasswordField based renderer and editor. Looks good. But the problem is We have to type the values and must hit "ENTER". In that image, I have typed…
Vigneshwaran
  • 3,265
  • 6
  • 23
  • 36
4
votes
2 answers

JTable trouble changing colors for first column

i try to change the color of fields in a JTable according to their value. I don't want to change any color of the first column but it changes anyway in a buggy way(some fileds are not correctly filed like University and Possible_Reviewer): My code…
kasten
  • 602
  • 2
  • 6
  • 17
4
votes
4 answers

Why is my JTable CellRenderer running all the time?

//newbie question I have a JTable with an almost basic cell renderer (it colors the line differently). I've noticed my cell renderer is constantly running for the lines that are displayed on the screen, even when I don't do anything with the table.…
Yossale
  • 14,165
  • 22
  • 82
  • 109
4
votes
1 answer

tableview cell disappears when scrolling

This problem does not necessarily occur Sometimes it disappears when sliding and sometimes does not disappear more information here click to show gif click to show storyboard png code HSubjectCell *cell = [tableView…
4
votes
1 answer

Displaying additional icon on the left side of a JTable column header (Nimbus)

I want the column headers of my JTable to get an additional icon on their left side when their values are the base of the table's rowFilter. The sorting icon shows on the right side, so "glueing" the two icons into one doesn't count (although I also…
ssr
  • 93
  • 6
4
votes
1 answer

Java JTable header word wrap

I am trying to get the header on a table to have word wrap. I have managed to do this but the first data row is expanding. The code for the table is: public class GenerateTable extends JTable { private JCheckBox boxSelect = new JCheckBox(); …
user4031188
4
votes
4 answers

Overriding CellRenderer, ImageIcon disappears

Hovercraft Full of Eels helped me already by pointing me too a TableCellRenderer but now: I can draw a circle with no problems. I'm just confused as how the original ImageIcons(inside all cells) get overriden with empty cells and a black circle.…
ManyQuestions
  • 1,069
  • 1
  • 16
  • 34
4
votes
1 answer

jtable cellrenderer changes backgroundcolor of cells while running

I'm trying to create a table and color specific cells either yellow, red or white, depending on the content of other columns. For that I am looping through the rows filling in the values and then checking on the contents. that works just fine for…
Steffen Riek
  • 61
  • 1
  • 1
  • 5
4
votes
1 answer

Swing - Setting the color of a cell based on the value of a cell

I would like to set the color of a cell based on the value of the cell. Having googled around for a bit i found out that i can do it using something like this: public class TableCellRenderer extends DefaultTableCellRenderer { @Override …
ziggy
  • 15,677
  • 67
  • 194
  • 287
4
votes
3 answers

Jtable with double cell type precision

I have to make one of my columns in JTable which is double type to get only numbers and to round all with precision 2. Not only to show them with this precision but instead to write the number into data with precision 2. In fact if I write 2.456 it…
user1761818
  • 365
  • 1
  • 7
  • 14
4
votes
1 answer

Designing simple cell renderer for Nimbus look and feel

I have a simple-ish cell renderer which is composed of a few JLabels (the renderer itself extends JPanel) and I'm trying to get it to render sensibly in the Nimbus look and feel. Basically what is happening is that in the lighter rows (as Nimbus…
oxbow_lakes
  • 133,303
  • 56
  • 317
  • 449
4
votes
3 answers

Coloring jTable row

I want to color specific rows in jTable..i did it for columns by using this code, private class CustomCellRenderer extends DefaultTableCellRenderer { /* (non-Javadoc) * @see …
Luna
  • 956
  • 4
  • 15
  • 28
1 2
3
31 32