FAQ Database Discussion Community


JButton within JTable Icon/Animation Changing When Pressed

java,swing,jtable,jbutton,tablecellrenderer
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...

How do I color individual cells of a JTable based on the value in the cell?

java,swing,colors,jtable,tablecellrenderer
I am attempting to make a Tetris clone. The game uses a JTable as a representation of the board. The board is a 2D integer array. I am trying to make it so, when a certain cell has a certain value, the cell will change to a certain color. I...

Coloring Text in JTable Cell

java,regex,swing,jtable,tablecellrenderer
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 should not match by the regex. example:...

Adjust one cell in JTable instead of whole row

java,swing,jtable,tablecellrenderer
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...

Change JTable cell colours without clicking

java,swing,jtable,tablecellrenderer
In a nutshell, I've got a JTable populated with hex data. The table remains on screen whilst some background processing occurs. The background processing checks some 8 byte values, and if for example, the first 8 bytes are processed successfully, I need the first 8 cells in the table to...

Replace checkbox with String for Booleans in DefaultTableCellRenderer

java,swing,jtable,boolean,tablecellrenderer
I've been trying to learn JTable renderers, and have nearly nailed down the behavior I'm looking for, save for this last part. I want to remove the checkbox that JTable renders by default for booleans and render a simple String instead, and I just can't wrap my head around my...

Image not showing in Jtable with renderer

java,swing,jtable,imageicon,tablecellrenderer
I have created a CellRenderer for my table. It works fine if the image is with small size. However , if it's a little large it shows me blank space public class ImageRenderer extends DefaultTableCellRenderer { JLabel lbl = new JLabel(); JButton bouton ; List<Commentaire> liste; ImageIcon icon ; Commentaire...