jtable

Wrong JTableHeader component orientation with RIGHT_TO_LEFT + AUTO_RESIZE_OFF in JScrollPane

Using Swing on Java 6u16, WinXP SP3 Hello to all. I need some help, please, with the following case. Basically I use a JTable inside a JScrollPane, that on the scrollPane I apply component orientation of right-to-left. The final result that I get is such that the table is indeed is attached to the right, but the header is placed to the ...

automatic filtering in JTable

I have a standard JTable with certain data inside. I would like to create an automatic filtering function: as the user types in a specific textfield the words the filtering process is started automatically, without the need of a clicking a button. Is it possible in Java Swing? ...

JTable - compound editor focus

I have a custom editor composed of several components. Something like: class MyCellEditor extends AbstractCellEditor implements TableCellEditor { JTextArea textArea; JButton button; JPanel panel; MyCellEditor() { textArea = new JTextArea(); button = new JButton(); panel = new JPanel(new BorderLay...

Using JTable for a JTree cell editor

I would like to use a JTable for editing a JTree, I extended DefaultTreeCellEditor and implemented isCellEditable getTreeCellEditorComponent, in getTreeCellEditorComponent I return a JTable. Everything works up to this point when a node is edited swing displays the JTable filled with the objects content however when editing is complete, ...

Removing a JTable from Frame

I have a program that is displaying a list of students - which are enrolled in the selected course - in a JTable. How can I remove the JTable before updating it when another course is selected? As it is, when the selected course is changed, the new JTable with students for that course is simply appended below the previous one. ...

JTable change the row height dynamically

i am having trouble changing the height of the my rows dynamically, is there a method i need to overload? --Edit-- Sorry for the short post it was my first ....My problems was really to do with changing the row height depending on the content. So what i have done so far is made a inner class that implements TabelCellRenderer. This is...

JTable very slow

Hello, I have a JTable in a swing application. I wrote a quick and dirty un-dock operation where the JTable is removed from its default parent and gets added to a seperate JFrame. When the JTable is undocked and placed on a seperate JPane it is REALLY slow at moving around in the JTable... as soon as I dock it back into its original pl...

How to set right alignment in JTable cell?

I am creating one application with billing facility, In that I want the amount column only display in the right alignment. Can anyone suggest me? Thanks in advance. ...

Java Swing - Deleting rows from table with AbstractTableModel()

Hi, I have a table off AbstractTableModel. The data in the table is stored in a Vector. Now, when I remove a row, I am removing it successfully from the vector, but this is not getting updated in the view i.e. in the GUI. I read elsewhere that I need to use fireTableRowsDeleted(), and I am trying to call it inside a wrapper method in ...

Quick problem with JTable

I've set up my frame with a JTree on the left and a JTable on the right, and used a BorderLayout to accomplish this. However, as soon as I put any data in my JTable, it expands to cover nearly the whole frame, and my JTree with it. The table currently has no data in at all (I'm verifying my SelectionListener), just a couple of column hea...

Java: ascertaining a user's edit on a custom model JTable in order to save to a binary file

Hi folks, How do I obtain the user's edit input on a custom model JTable created from a binary file in order to save it to the binary file? I suspect that my table model's getValueAt(int, int) method is the problem because it returns data from the binary file before the edit, not the data in the particular cell. To give you an idea o...

JTable add/remove rows to custom table model (updating table display)

Does anyone have a good example of how to Add/Remove rows from a JTable using a custom table model? The issue I seem to be having is how to have the table keep updating when I add or remove items. The real simple idea here is to have an add and remove button above my table which allows the user on the fly to change the table. ...

Java Swing - ImageIcon in Jtable within a JScrollPane

I have a JTable inside a JScrollPane. In one of the columns in the JTable, I have ImageIcons being displayed. Everything works fine, however, I have that in windows XP, when you scroll the rendering messes up and images become distorted. This only happens when you scroll. Screenshot: http://i.imgur.com/NKqYT.png Any help much apprecia...

How to highlight part of a JLabel?

Before any one suggests HTML, I explain later why thats not an option here. I have a table that contains a column with text cells in it. I need to be able to highlight some of the text in each cell. So for example if the cell contained "cat foo dog"... I might want to highlight foo. My current method is to use a custom table cell render...

How do I set the JTable column and row color?

How do I set the JTable column and row color? ...

How to add row in jTable ?

Do you know how can I add new row to jTable ? ...

JTable adjust column and row width according to Data

I need to show the below data in a Jtable cell.As of now everything comes in a single line even-though i'm overriding the object's toString method with newline characters.How can I set the Jtable to adjust the cell height and width depending on the data. Segment ID: 1 Elevation : 2.0 Azimuth :30.0 ...

Java Swing JTable; Right Click Menu (How do I get it to "select" aka highlight the row)

Hi all. Short: I need a "right-click event" to highlight the cell row. I am using a JTable inside a ScrollPane in Java Swing (Netbeans Matisse). I have a MouseClicked event listener on the JTable that does the following: if (evt.getButton() == java.awt.event.MouseEvent.BUTTON3) { System.out.println("Right Click"); ...

Date time picker inside JTable

Is it possible to add a DateTimePicker to a JTable Cell.A particular column should be updated with date and time..Is it possible to add such a component to a JTable ...

Does not preserve the value of cell

Posted CellEditor. import java.awt.Component; import javax.swing.AbstractCellEditor; import javax.swing.JComponent; import javax.swing.JTable; import javax.swing.JTextField; import javax.swing.table.TableCellEditor; public class UserCellEditor extends AbstractCellEditor implements TableCellEditor { JCo...