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

InsertRow and automatic render in JTable

i have a JTable and a custom table model , wich has in some places Double.class as column class. I read from a database and then insert result to the table. I want the numbers to be rendered with 2 decimals so i use this class public class…
nachokk
  • 14,363
  • 4
  • 24
  • 53
0
votes
1 answer

TableModel in Java: how to specify different renderers for different rows?

I'm making a custom TableModel usingAbstractTableModelfor a project, and I need to figure out a way to have a checkbox show up on some rows, but not others. I have already implemented a getColumn method, but I want to be able to have a checkbox not…
nameless912
  • 367
  • 1
  • 12
0
votes
1 answer

How to color a particular cell in JTable example color cell number (2,2)?

I have this code and i want to color each cell with a different color for example i wanna color cell number 1,1 with red and cell number 1,2 with light red and so on.How is it possible?i went through many examples but all of them show how to color a…
maddy
  • 109
  • 4
  • 13
0
votes
1 answer

Change the color of a row in a jTable

I have a jTable as following : I want when the value in the Quantité is less than the value in the Min seuil de suantité, to change the color of the row to pink. In the load of the program all works fine, but when I do some event like click on the…
Aimad Majdou
  • 563
  • 4
  • 13
  • 22
0
votes
1 answer

changing color of a row in JTable

I am trying to change the color of entire row due to a column's value. the columns I test it's value is the third one in my table. Here is my cell rendering class code : public class CustomTableCellRenderer extends DefaultTableCellRenderer { …
Aimad Majdou
  • 563
  • 4
  • 13
  • 22
0
votes
1 answer

JTable Custom TableCellRenderer displaying images

I have a JTable which I would like to display an image depending on the content of a cell, I understand in order to accomplish this I have to implement my own custom cell renderer, which I have already, however, as soon as the first image is drawn…
user2426634
  • 25
  • 1
  • 2
  • 5
0
votes
1 answer

JTable-Paint the content(text) in a cell

I have a JTable and i have a method which implements search in table rows and columns, i use regular expressions and i want to paint(eg yellow) the text which matches with the regular expression in the cell. I want to paint the text not the…
user1005633
  • 625
  • 3
  • 9
  • 23
0
votes
1 answer

A constantly scrolling JProgressBar

I would like to ask: Is it possible to have a JProgressBar that moves incessantly unless stopped explicitly? I know that the most common way to use a JProgressBar is to listen for changes and to change the progress by using the setValue(). If…
An SO User
  • 24,612
  • 35
  • 133
  • 221
0
votes
1 answer

TableHeaderRenderer with Nimbus

I'm have a custom table header renderer that will have the standard label and a button inside a JComponent. The issue I'm having is with the label returned by the default renderer. The call to the default renderer provides the standard label. If I…
Dodd10x
  • 3,344
  • 1
  • 18
  • 27
0
votes
2 answers

MS Access DB in JTable which cell with date have only date without time

I have read some questions here, but still I don't understand how to "trim" the date, that JTable cell(column) will have only date without time. Now I have date and time in cell, but in DB stred only date, thats why I have everywhere 2013-04-02…
usr999
  • 157
  • 2
  • 7
  • 20
0
votes
1 answer

Mark the duplicates in a JTable

I have created a JTable with the help of AbstractTableModel. I would like to mark (change the color of the cell) in a this JTable the third column which has the same entry as the second column. For example: and so, with the help of this post Check…
Dimitra Micha
  • 2,089
  • 8
  • 27
  • 31
0
votes
2 answers

Jtable, use different alignment for each ROW

I have created a table and need to align every second row to the right, and every other row to default. I understand how to align the rows. This is my default renderer final DefaultTableCellRenderer centerRenderer = new…
den
  • 1
  • 1
0
votes
1 answer

Add Clickable JPanel to AbstractTableModel

I have a class that extends AbstractTableModel and I'd like to insert a JPanel with clickable text (think hyperlink) into one of the cells. Is this possible? Currently the output in my cell with JPanel looks like…
MCR
  • 1,633
  • 3
  • 21
  • 36
0
votes
1 answer

Rendering Toedter's JDateChooser in JTable column

Excuses for asking the same question again. I am under the impression that if I added to the original question, I wouldn't get as many views. As I'm using an MVC pattern, my Swing GUI is in a different class with the controller creating an instance…
0
votes
1 answer

Value difference between TableModel and CellRenderer

I've created ColumnAutofitTable extending JTable, with reference to http://tips4java.wordpress.com/2008/11/10/table-column-adjuster/ However it shows strange behavior sometimes as attached picture. By writing some logs I found that values in…
Shoner Sul
  • 105
  • 1
  • 12