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

Color Renderer in JTable if it is non editable field?

I have 3 columns in JTable. One column is editable. Other columns are non-editable. Editable column should be displayed green color and non-editable column should be in red color. I have tried with DefaultRenderer class but its not working. Please…
shree
  • 2,745
  • 7
  • 28
  • 35
-1
votes
2 answers

Cells in JTable change appearance after scrolling horizontally

My Java 8 app uses a JTable inside a JScrollPane. Currently the table has more than 10 columns and the data is added using DefaultTableModel's addRow(someObjectArray). All cells in a column currently have the same type of data but columns 4+ can…
Neph
  • 1,823
  • 2
  • 31
  • 69
-1
votes
1 answer

Swing -- background colour only shown if selected?

Alright, so I have an IndirectListModel allowing for multi-selection of rows that I bind to a JTable, all cells of which I set the following renderer for: private static class MyVerificationHighlightingCellRenderer extends…
User1291
  • 7,664
  • 8
  • 51
  • 108
-1
votes
1 answer

Removing added custom cell renderer

I have created a custom cell renderer to fill a cell by a particular color. public class ColorInCellRenderer extends DefaultTableCellRenderer { private final Map cellColors = new HashMap(); public…
Ann
  • 21
  • 6
-1
votes
1 answer

Use custom JTableCellRenderes

I have a JTable with 6 columns. When adding a row to the table I need to add black color for the last cell in fist row. red color for second row. The corresponding color comes from a different method. This is my custom table cell renderer. class…
Ann
  • 21
  • 6
-1
votes
1 answer

Swing: Table cell renderer creates infinite loop

I want to create a swing table with cell's line wrapping, so I have created the following renderer that makes use of a textarea. The problem is that it creates an infinite loop if I set the row height using the setRowHeight method inside the…
v8rs
  • 197
  • 4
  • 17
-1
votes
1 answer

JTable - Sorting rendered values column

In JTable, all the columns can be sorted by using Table.setAutoCreateRowSorter(true); method. But the sorting is not properly in one column in that table which contains cell renderer. If you have any idea about it, please reply.
-1
votes
2 answers

buttons not getting displayed in Jtable when values are fetched from database

So basically the requirement is to fetch results from database based on the search query. Results are displayed in JTable. The results should have 5 columns. The 4 columns contain values fetched from database. The 5th column is supposed to have…
user3608233
  • 103
  • 2
  • 13
-1
votes
2 answers

Executable Jar With Button setCellRenderer() not Working

I have a serious Problem. I am Using Jtable in which i added a buttons using this code. TableColumn buttonColumn = tableSupplier.getColumnModel().getColumn(8); TableButton buttons = new TableButton(); buttons.addHandler(new…
-1
votes
1 answer

CellRenderer Fails After JTable is Passed to JForm

I am trying to populate an existing JTable in an existing JForm. All is well except the CellRenderer formatting (it formats to £currency) is not maintained once the table is passed back to the original JForm. The data is OK but the formatting…
-1
votes
1 answer

Change JTable row foreground

I am trying to color to RED, the foreground when a time is around some condition, but is painting the foreground of ALL rows(should be only seven).What i am doing wrong?Code below: class RedRenderer extends DefaultTableCellRenderer{ …
LeeP
  • 43
  • 1
  • 1
  • 6
-1
votes
1 answer

JTable Rendering with checkbox

Is there anyone know how I can add a checkbox in this code: String data[][]={ {"Apple","Banana","Mango"}, {"Apple","Banana","Mango"}, {"Apple","Banana","Mango"} }; String column[]={"Fruits","Fruits","Fruits"}; table=new JTable(new…
user2322019
  • 1
  • 1
  • 5
-1
votes
2 answers

How to change color of cell in JTable and animate it?

I have a JTable with numbers. I know how to change color of one cell or all cells. But how to change color of cell in and animate it ? For example, The first cell of red, there is a delay, and the second cell is painted in the same red color and so…
mr.ANDREW
  • 51
  • 1
  • 7
-1
votes
2 answers

Customizing my Cell Renderer to change one cells colour?

note: this code is not mine, I have taken it from another site and i'm simply trying to modify it. I have a JTable with a load of details however, I want it so that when I change a particular cell for the first cell to change colour. Currently this…
user2207177
-1
votes
1 answer

If a cell value is same, changing a cell background in JTable

I have a question for JTable. When I select a cell and then there are same value cell in JTable which I chose, that cells highlight background red color. I don't know what to do.... P.S: I am sorry, I do not know how to enter the code in here...;;
1 2 3
31
32