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

how to blink table cell continuously after false if statement in swing

In swing application, I am using DefaultTableCellRenderer to flash the table cell when the cell time is equal to system time. I wrote if statement to compare cell time with hh:mm , If both time are equal, time cells backgroung will blink on the…
151291
  • 3,308
  • 7
  • 48
  • 81
0
votes
3 answers

TableCellRenderer using data from another cell

I have jTable1 with 2 columns. I want to control column 1 look, so I use the folowing code to set text font in cells bold or not based on if the cells row is even or odd. import java.awt.Component; import java.awt.Font; import…
geo
  • 517
  • 1
  • 9
  • 28
0
votes
0 answers

How to detect JTextArea is used as a CellRenderer

In my code I want to enable/disable certain functionality based on the context JTextArea is placed. For Example: If JTextArea is used as a CellRenderer I want to disable certain funcionality. How can I detect, if a particular JTextArea component is…
Hirantha
  • 337
  • 1
  • 4
  • 14
0
votes
2 answers

Trouble with TableCellEditor and JComboBox

I'm trying to get a jtable to contain combo boxes for one of it's columns but it doesn't work, it just appears as a normal table cells. at the moment i'm following oracle's example:…
ido flax
  • 528
  • 1
  • 10
  • 19
0
votes
2 answers

java table CustomTableCellRenderer change row color according to cell content value

i am developing java application .i want to show data in a table which has 3 column name course and year .i use tablerenderer according to a tutorial found on internet.this code actually doing is colorize rows with cyan and gray color according to…
user3003149
0
votes
1 answer

Adding coloured row to JTable

I have a form to fill and 3 chekbox(yellow-orange-red), when i fill the form and select a colour I click a button which will add a row whit selected colour to the Jtable . I used a TableCellRenderer It works but when I do the operation three or four…
hamza-don
  • 455
  • 5
  • 26
0
votes
1 answer

java jTable CustomRenderer background color only change when i click it ..why this case happen

i'm new to java i create java application using netbean ..i created javatable (tb1 is variable name)..i have add 2 rows and 2 columns ..i have 1 button ..everything i wanna do is when i clicked a button change the background color of first column…
user3003149
0
votes
1 answer

how to insert more than one jComponents into a cell in a jTable

I have a jTable which is populating according to my requirement . I want to add two comboboxes into all the cells in one column. So can anyone help me on this... ![here is my table ][1] [1]: https://i.stack.imgur.com/nC9RL.jpg I need to add two…
user2688705
0
votes
1 answer

Changing jtable cell color after jitem click

I am new on Java Swing. I have jtable which in column 2, when doing a right click on a cell a jpopmenu shows with two options(in progress / solved) and I want to modify cell color to green when clicking option "Solved". I know that I need a cell…
hamza-don
  • 455
  • 5
  • 26
0
votes
2 answers

setCellRenderer() not working

I am trying to set a Renderer for a specific Column, but somehow this renderer is not being used for rendering that column. Is there any explanation for that? tabledata = new LendDataTable(); table.setModel(tabledata); TableColumn xx =…
joz
  • 652
  • 2
  • 8
  • 19
0
votes
1 answer

Error when sorting rows in Jtable

I'm trying to set a RowSorter on my Jtable, I used the method setAutoCreateRowSorter(Boolean b) to sort the rows table.setAutoCreateRowSorter(true); But when I make the table as rawSorted, I get a strange error! The conflict is visible when I want…
BinaryMan
  • 269
  • 2
  • 6
  • 18
0
votes
1 answer

In JTable, updating displayed item when cell-unique JComboBoxes are edited

I have a GUI with a column of JComboBoxes, where each one is unique. I really don't understand what I'm doing so the latest in an extrodinarily long sequence of roadblocks is that when a box is edited, it doesn't display the newly-selected value. If…
Mr. Wallet
  • 17
  • 4
0
votes
2 answers

Change Color Of JTable Rows

I have two JTables tblOrderInfo and tblDetailInfo i want to color the tblOrderInfo rows on the basis of tblDetailInfo rows, i have done lots of research and found Rob Camick's article and many other articles but it works for the Coloring based on…
0
votes
1 answer

Update Icon in JTable after user input

I need to update an icon in JTable after the user digit a number in a JTextField. Step-by-Step: The user clicks in a JTable row, and after that, opens a JFrame to edit its contents. There is a JTextField in that EditFrame where the user put a…
LeeP
  • 43
  • 1
  • 1
  • 6
0
votes
1 answer

how to extend BooleanRenderer

I'm trying to implement mouse hover effects for my JTable. (When the mouse goes over a table's row the row's background changes). In order to do that, I extended the DefaultTableCellRenderer like this: public class FileTableCellRenderer extends…
user1028741
  • 2,745
  • 6
  • 34
  • 68