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

Swing: most computationally-efficient way to blink particular cells in a table

I need a way to draw attention to particular cells in a large JTable (20x16!), and I want to know what it would take for the text to blink, e.g. 900msec on and 100msec off. (I'm familiar with the concept of a TableCellRenderer) Is there a way to do…
Jason S
  • 184,598
  • 164
  • 608
  • 970
3
votes
3 answers

JProgressBar setValue is not working, tried with SwingUtilities as well

I have implemented a JProgressBar in a JTable. I used renderer for the ProgressBar NOT EDITOR. Now I tried to implement a ProgressBar set value but due to EDT its not working so I used SwingUtilties but it did not work as well. EXPECTED BEHAVIOUR -…
Abhishek Choudhary
  • 8,255
  • 19
  • 69
  • 128
3
votes
2 answers

Cell won't update after an action is called in the cell editor

I'm using a table with a cell renderer which allows me to place a button "x" in each cell with a value so that i can delete the value of the cell by pressing the button. The cell editor assigns the action listener to the button and the proper…
user1149359
3
votes
1 answer

JSlider in JTable

For putting a JSlider into a JTable I wrote am AbstractCellEditor which implements a TableCellRendererand a TableCellEditor. It gets initialized with values from 0 to 100. I have the strange behaviour that when I first click onta a slider it jumps…
Razer
  • 7,843
  • 16
  • 55
  • 103
3
votes
2 answers

JTable - cell editor is not high enough to fit the text

I'm using standart JTable with standart cell editor to edit string values. On some platforms, when cell editor is opened, text doesn't fit in it and part of the text is cut. For example "_" symbol is not visible, as well as it's hard to distingush…
Oleg Vazhnev
  • 23,239
  • 54
  • 171
  • 305
3
votes
2 answers

JTable TableCellRenderer background with NimbusLookAndFeel color problem

I'm using NimbusLookAndFeel. With this look and feel JTable's cell background are alternatively white and light grey (it depends on the row number). Now, I'm writing some custom cell renderer implementing TableCellRenderer. I need to set the…
Heisenbug
  • 38,762
  • 28
  • 132
  • 190
3
votes
1 answer

Using TreeTable with different root and node types

I have the following problem: I want to have a JTeeTable-like table component except that the roots (classes below) and the nodes of the tree are not of the same type. For instance, suppose that I have the following classes: public final class Entry…
user276002
  • 178
  • 3
  • 10
3
votes
4 answers

How can I vertically align all my contents of my Table View Cell?

I want to make all the contents in my table cell vertical align center. I want my content to render at the red line I've tried via code func updateTableViewContentInset() { let viewHeight: CGFloat = view.frame.size.height let…
code-8
  • 54,650
  • 106
  • 352
  • 604
3
votes
2 answers

JTable not honoring cell renderer's necessary height

This should be simple, but I can't figure out what is going wrong. I need my table to display with a fairly large font size but the table painter is not honoring the height of the cell renderer. I've seen this post and it's working brilliantly for…
skiaddict1
  • 523
  • 7
  • 19
3
votes
1 answer

JTable Column Headers with wrapped and center aligned text

I am currently trying to wrap and align center text of a column header. The problem seems to be that while the first line of column header is aligned, the second one does not get aligned properly. I am using DefaultTableCellRenderer to render it as…
KyleKW
  • 300
  • 1
  • 11
3
votes
2 answers

Adjust one cell in JTable instead of whole row

I have run into a slight issue and am struggling to resolve it. Basically what is happening is that I have a JTable which is being populated by an array that I get from an API call. What I currently have is that if a device shows as online it will…
basic
  • 3,348
  • 3
  • 21
  • 36
3
votes
2 answers

TableCellRenderer sets color to many cells and not just one

I have a JTable, that I want I want to be able to change the color of a single cell that is clicked on. Here is a simplified version of my code: public class TableFrame extends JFrame { public TableFrame() { JTable table = new…
user2397282
  • 3,798
  • 15
  • 48
  • 94
3
votes
1 answer

JTable copy value from view of cellrenderer

I have a JTable with a cellrenderer and my table is non-editable. When i select a cell and copy (ctrl-c) the value, its copying not the shown in the cell, it is copying the value which store in model. How could I copy cell value which shown in…
rdonuk
  • 3,921
  • 21
  • 39
3
votes
1 answer

Button text in JTable renderer not visible. Why?

I have a custom cell renderer set in JTable and it works but instead an "x" visible on buttons being table cells I see "..." (three dots). What did I miss ?? /*************************************************************************** * Listener…
Łukasz Bownik
  • 6,149
  • 12
  • 42
  • 60
3
votes
1 answer

How to make a JProgress bar with a gradient

I am using swing and wanting to make my JProgress bar look more attractive by adding a soft gradient to it that matches the theme of the app. My progress bar is in a JTable cell which i have working but my current example paints the cell with a…
Riaan Schutte
  • 535
  • 1
  • 5
  • 14