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

Alignment in a JTable cell

I am using the following DefaultTableCellRenderer to display currency in my tables. It works fine too, only problem I have is, the numbers in the columns I set this renderer on are aligned left, everything else is aligned right. I´d like to know…
Jannis Alexakis
  • 1,279
  • 4
  • 19
  • 38
0
votes
1 answer

set a combobox value in default cell editor and renderer JTable

I want to select a value in a default cell editor combobox initially. When i set that inside renderer or editor the combo always shows the same value even if the user changes it, since i am setting the value in renderer. How to set the combobox…
Mohamed Iqzas
  • 976
  • 1
  • 14
  • 19
0
votes
1 answer

JTable update columns header height after multiple header insertion

What should be invoked /fired when I added new column to the table but its header label has more lines (using html and br element) than in the already presents headers so the headers will resize accordingly? Before adding After adding This does…
ps-aux
  • 11,627
  • 25
  • 81
  • 128
0
votes
2 answers

Format text into JTable cell

I want to dispose the text inserted into a JTable cell in a particular way. Infact now if I write into a cell, the text will be all on the same line, while I would like to see it in two lines. Maybe I would be clearer with a graphic description.…
Bernheart
  • 607
  • 1
  • 8
  • 17
0
votes
1 answer

Meaning of getTableCellRendererComponent argument

This is my very first StackOverflow question, so if I do/ask something incredibly stupid, please be lenient! I'm a noob when it comes to Java, specifically swing, and I'm having trouble understanding the getTableCellRendererComponent function of…
queenbee
  • 155
  • 1
  • 7
0
votes
0 answers

Java CheckBox TableCellRenderer bad behavior

I'm having a strange problem with my custom TableCellRenderer for Checkbox rendering, which works correctly on the first line but on the others, it sets un/selected all the checkboxes between first click and second one. Here's the code : /*This…
0
votes
1 answer

How do I use setCellRenderer properly?

Right now I have this code jTable1.getColumn("Progress").setCellRenderer(new TableCellRenderer() { @Override public Component getTableCellRendererComponent(JTable arg0, Object arg1, boolean arg2, boolean arg3, int arg4, int arg5) { …
user2519193
  • 211
  • 2
  • 14
0
votes
2 answers

Can you set the cells of JTable to spill over?

I'm trying to imitate some Excel spreadsheet functionality on my JTable, specifically what I've been calling cell spillover or cell overflow. This occurs when you fill a cell with text with a wider width than the cell is set to. If there is no text…
0
votes
1 answer

Using TableCellEditor and TableCellRenderer at the same time?

I am using a TableCellEditor : package gui.table; import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import…
Hans En
  • 906
  • 5
  • 15
  • 32
0
votes
2 answers

Default Table Model doesn't show new lines

Hi i want to show new line in DefaultTableModel but i dont know why table doesn't show enters. How to enable enters? If i have a string "stss\nsdd" it shows "stsssdd" but i want new line. public class Main extends JFrame { DefaultTableModel…
Luffy
  • 677
  • 1
  • 6
  • 19
0
votes
2 answers

JTable colors all cells and not only the specific cell

I have a problem with a method that should change the color of one specific cell i a JTable, however all the cells change color. This is the method I am trying to implement: public Component cellBG(JTable table, int row, int column) { …
abbisDK
  • 35
  • 1
  • 1
  • 9
0
votes
1 answer

Editable cell and growable Jtable Implementation

I have a JTable with Customized CellRenderer and CellEditor, Intially the table is loaded with a list of values Say with 12 rows and 5 colums, I have a JTextField at the top of the table in which I applied KeyListener and made the Textfield to…
Wiki
  • 245
  • 3
  • 13
0
votes
1 answer

Action from KeyBinding don't execute on a JTable cell

im having a problem that is cause i CAN edit the cell when not having focus but when i press the bind key in the cell ("Enter"), action is not performed. But when is has focus, action is performed correctly. I only want to add the keybinding for…
nachokk
  • 14,363
  • 4
  • 24
  • 53
0
votes
1 answer

TableCellEditor doesn't show properly

Im having trouble editing a cell, i'll picture cause my english is not very good. I add a TableCellEditor (extends a DefaultCellEditor, i know is not the best but the code is not mine). When i type letters are not , i tried to…
nachokk
  • 14,363
  • 4
  • 24
  • 53
0
votes
1 answer

need to split the particular cell in to two JTextField in Swing Java

i am having one Jtable and assign rendered for column. Now i want to split particular cell into two parts so that i can provide two value in to it. Splitting can be through Cellrenderer or may be anything else.
Vikas Singh
  • 2,838
  • 5
  • 17
  • 32