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
8
votes
2 answers

Jtable with different types of cells depending on data type

How can I implement a JTable with different types of cell editors depending on the type of input a particular row is displaying? For example some rows could be checkboxes (for boolean types) some rows could be comboboxes (if I want to provide a…
MxLDevs
  • 19,048
  • 36
  • 123
  • 194
8
votes
1 answer

Default color of JTable row

I have written one program where I am highlighting certain rows based on criteria.I posted one question regarding that :- JTable CustomRenderer Issue Solution given for this problem was that I need to set color in else for rows which do not come…
Addict
  • 803
  • 2
  • 9
  • 16
7
votes
1 answer

JTable Set Cell Color At Specific Value

I'm trying to write a method which for given parameters (value, color), sets color on the background of a cell which has value equal to cellValue. What my method actually does is, it sets color on the background of a cells for whole row and when I…
Xerath
  • 1,069
  • 5
  • 17
  • 26
7
votes
2 answers

Table cells with HTML strings inconsistently rendered as multiline

Cells of one of columns in my table are HTML strings. HTML is used to provide some color indication. Usually the width of the column is enough to contain the whole string. But when it is not enough then the string is nicely cut on a word boundary.…
tenorsax
  • 21,123
  • 9
  • 60
  • 107
7
votes
3 answers

I would like to add a right-padding to a JTable column, is it possible?

I want to add right cell-padding to a column in my JTable, how do I do it? I tried searching online but I can't seem to find a definitive answer for this. I hope someone can help me. Regards, Chad
Chad
  • 2,041
  • 6
  • 25
  • 39
6
votes
3 answers

Setting the mouse cursor for a particular JTable cell

I have a JTable with a set of uneditable cells and I want all the cells in a particular column to have a different mouse cursor displayed whilst the mouse is hovering over them. I am already using a custom renderer and setting the cursor on the…
Tom Martin
  • 2,498
  • 3
  • 29
  • 37
6
votes
2 answers

Adding multiple JProgressBar to TableColumn of JTable

I have added multiple JProgressBar to TableColumn of JTable. I am updating all the JProgressBar with data after making certain calculations, but only the last ProgressBar(in this case ProgressBar progressObj4) which is added is getting updated. How…
chiranjib
  • 5,288
  • 8
  • 53
  • 82
6
votes
1 answer

Swing: table cell rendering doesn't work right for JXTable?

I'm trying to override the highlight color of a JXTable based on the value of certain row items. Here's an example where the highlight is green if the row item value has getNumber() % 2 == 0. It works fine for JTable, but for JXTable, it looks like…
Jason S
  • 184,598
  • 164
  • 608
  • 970
6
votes
3 answers

Java JTable disable single cell selection border highlight

I have a JTable with three columns in each row, see the image: For some reason depending on the column i select i get the little dark blue border around it (V140116554) in the image above. I currently use this to select the entire…
Alosyius
  • 8,771
  • 26
  • 76
  • 120
6
votes
2 answers

Set the button "background" of a Nimbus button

I'm working on an app using the Nimbus Look and Feel. There's a table and one column contains buttons (using the Table Button Column from Rob Camick). That does work, but the result isn't what I had expected. I have tried to fix the look, but to no…
DarkDust
  • 90,870
  • 19
  • 190
  • 224
5
votes
2 answers

how to add different JComboBox items in a Column of a JTable in Swing

I want to add JComboBox inside a JTable (3,3) on column 1. But in the column 1 , each row will have its own set of ComboBox element. When I tried to use table.getColumnModel().getColumn(1).setCellEditor(new…
Abhishek Choudhary
  • 8,255
  • 19
  • 69
  • 128
5
votes
1 answer

Color only specific cells in JTable

I'm looking for a solution for this problem: I have an excel file, that contains data. Some of the cells have yellow background. I already created a code for importing the text to JTable, which works fine. But I want to import the…
radox1912
  • 53
  • 2
5
votes
1 answer

Change background color of JTable row based on column value

hi i am new in java jtable cellrendered. I am looking for a way that works in my program but i dont have any luck finding it. Here is my Jtable Employee ID | Name | Status | Position 00565651 Roger Active …
Lileth Hernandez
  • 61
  • 1
  • 1
  • 3
5
votes
1 answer

CellRenderer - Making text bold

How to make the text in JTable bold, I tried the following, It does work for colours but for making the text bold i'm going wrong somewhere class ColourRender extends DefaultTableCellRenderer { public Component…
5
votes
3 answers

How to create a different model of JTable?

I want to add on my system another design/model of JTable. It is a simple design but for me (as a novice) I have difficulties setting this kind of table. I want the table to be look like this: Is it possible to design a table like this in Java?…
Jay Marz
  • 1,861
  • 10
  • 34
  • 54
1
2
3
31 32