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

When using TableCellRenderer to display a localdate in format dd.mm.yyyy my JTable search function does not work as expected

Basically the problem here is as follow, I have this TableCellRenderer: public class CellRenderer_LocalDate extends DefaultTableCellRenderer implements TableCellRenderer { private static final long serialVersionUID = -9184414041940041458L; String…
Corey
  • 94
  • 10
2
votes
2 answers

Netbeans problem with CustomTableCellRenderer

I am trying to add a different data types (to make JTable sort integer columns in a proper way) to my JTable and at the same time to render the table to see odd rows darker than even rows. I have the following code of my TableCellRenderer: public…
Max
  • 23
  • 1
  • 4
2
votes
2 answers

Painting cells certain colours depending on value within previous row JXTreeTable

I've got a JXTreeTable with a custom cell renderer. I am attempting to get the background colour of a row to change when a field in a row is different from the field in the previous row. Say for example that the row contains "1" as the ID. If the…
Bonnotbh
  • 515
  • 7
  • 24
2
votes
2 answers

TableCellRenderer selected cell problem

I want to implement a tablecellrenderer of a JTable component, which should show a different color depending on the cell data. I got this, but I can't change the color of the selected cell. I tried to do this: public Component…
jion
  • 363
  • 5
  • 16
2
votes
1 answer

JTable: get object location inside a cell

I can't figure out how to solve this problem: I have a JTable with a custom cell renderer. Inside a cell renderer I put a JLabel with a grid bag layout. If I try to obtain the location of the JLabel inside the renderer, I always get 0, 0. I tried to…
GavynSykes
  • 133
  • 2
  • 15
2
votes
1 answer

Defining Integers in Column Class breaks/skips the Table Cell Renderer?

After managing to get my columns to sort by defining the Column Classes - my Cell Render now only applies to Columns that contain String values and not applied to the Integer columns? This is what it looks like: ("% of target reached" is the Integer…
BlueSteel
  • 33
  • 5
2
votes
1 answer

Row selection function disabled after using a cell renderer

I'm cleary doing something wrong. My guess would be the component, but here's the problem. This is my cell renderer: public class WildcardCellRenderer implements TableCellRenderer { @Override public Component…
dierre
  • 7,140
  • 12
  • 75
  • 120
2
votes
1 answer

JTable icon linked to object

I have the following problem: i currently have a few classes representing various plants and animals, which all have base class "Organism", they are part of a world (another class, which contains a "2D" container of Organisms or empty fields - kinda…
2
votes
1 answer

How to make JLabel still appear after JTable column swap in the runtime?

I have a JTable: after I swap columns unfortunately the flags are not rendered anymore: I assume it is the fault of my getColumnClass method where I have fixed class for every column, but I don't know how to fix this issue. package zad1; import…
Yoda
  • 17,363
  • 67
  • 204
  • 344
2
votes
1 answer

Highlighting row selection in JTable with custom rendering

I am creating JTable with custom table cell renderer by extending DefaultTableCellRenderer where I would like to use some image along with the text. As you can see above, even though I have selected the particular row, it is not highlighting in the…
Dinesh
  • 16,014
  • 23
  • 80
  • 122
2
votes
1 answer

java set color of specific cells in table

I've to color text in cells of one column if value in it is greater than zero. I known, that there was already asks like this, but i can't find working solution despite several hours of searching. Everything gives me some errors. Solution, that…
anat
  • 53
  • 6
2
votes
2 answers

Change background color of JTable whole row based on column value

So what I am trying to do, is to change the color of each row based on values inside of the last column. I already found this solution: Change Background Color of JTable which worked very well. But in addition I want to switch the color of the row…
PlaZm0
  • 25
  • 1
  • 5
2
votes
3 answers

Coloring Text in JTable Cell

I want to color text in a JTable cell. I'm using a DefaultTableCellRender with HTML Tags to color multible words/text. I'm using Regex to find words/text and replacing them by adding HTML Tags. The problem here is that the HTML tags them selves…
lolung
  • 460
  • 3
  • 16
2
votes
2 answers

JButton within JTable Icon/Animation Changing When Pressed

I don't really know how to explain this in words. So I have a JTable with a JButton Column. I have set an icon for this button but when I press or hold the button, it changes into the image you see below. How can I disable this effect? I have…
mfrancisp
  • 119
  • 1
  • 2
  • 12
2
votes
1 answer

why cell renders differently when text in the cell has λ characters

I use a table with default cell renderer. i see when i use this letter(λ) in my text, it render the whole text in the cell in different way. I'm wondering if someone knew the reason and the solution.
itro
  • 7,006
  • 27
  • 78
  • 121