jtable

C#: is there a JTable equivalent?

In C#, is there an equivalent to the Java JTable? Additionally, I'd like to be able to have rows sorted by column when the user clicks on that column heading. Finally, I'd like to have two tabs, each with a "JTable" in it. ...

How to keep a single column from being reordered in a JTable?

I have a JTable and I need to be able to reorder the columns. However I want the first column to not be able to be re-ordered. I used the following to enable reordering: table.getTableHeader().setReorderingAllowed(true); The columns can now be reordered including the first column which I don't want. Is there any way to lock the first ...

BeansBinding a JTable in NetBeans

I want map a List of beans to a JTable. The idea is that each column will be a preselected field in the bean and each row will be a bean in the List. Slide #32 here looks very promising: http://swinglabs.org/docs/presentations/2007/DesktopMatters/beans-binding-talk.pdf However, NetBeans is not very friendly in letting me assign a bea...

[swing] hyperlinks in JEditorPane in a JTable

I swear... i hope this is the last question I have to ask like this, but I'm about to go crazy. I've got a JTable using a custom TableCellRenderer which uses a JEditorPane to display html in the individual cells of the JTable. How do I process clicking on the links displayed in the JEditorPane? I know about HyperlinkListener but no mou...

swing: saving dialog box resize dimensions

I have a dialog box with a bunch of dimensions that a user can change by moving/dragging, including a JTable with resizable/draggable columns. What I would like to do is to make the state of these resizable columns / dialog boxes / etc. persistent, so the next time my application starts up, the user doesn't have to go through the resizi...

Swing JTable Layout: how to make table occupy complete viewport - like in eclipse IDE

In the application I am building, I will be making a few tables display different data. And I want my table to look like the tables in Eclipse IDE, like in the Problems View or the Tasks View (ignore the tree structure of the Problems View) What I am mainly interested in is the last column in the above views indicated in the picture bel...

Making a JTable cell editable - but *not* by double clicking.

I am trying to add a column to a JTable with the following behaviour (similar to Windows Explorer and similar shells): The cell can be clicked once to select it, as usual. The cell can be double-clicked to perform a separate action (launching an external program.) The cell value (a string) can still be edited, by single-clicking a seco...

Java Swing : changing JTree selection while editingstopCellEditing() : how to get stopCellEditing() called before TreeListeners:valueChanged?

Hi, regarding to earlier question How to stop editing with DefaultCellEditor when a separate JBtton is pressed and Sun Bug 4724980: JTable: Add API to control what happens to edits when table loses focus.: With jtable.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); i get my CellEditor to stop editing when table loses ...

jTable grid lines for selected rows

I have a jTable set so that it is read only, and selection is done by single row only. However, when the user selects a row and the row is painted, the jTable's vertical grid lines between columns are removed, causing a single horizontal block of colour, instead of blocks of colour in each cell. How can I get the selected row to show t...

disable scrolling to cell in focus

I have a jtable inside of a scrollpane. how can i stop the scrollpane from scrolling up or down when a cell that is partly out of view gains focus? the problem is i am setting the cells to editable when the user mouses over them, so when you mouse over a cell that's partly out of view, the view changes suddenly. I don't like this behavi...

Manipulating fields in the jTable Java

I have populated my jTable with the following Code. It has two columns, the first has variable name and the second is a list of its dependencies. The user can change the dependencies by selecting them from the list in the jTable. When the user changes a value, I want to row to be added to another jTable (which would be no user editable....

Adding an Icon to JTable by overriding DefaultTableCellRenderer

I'm trying to add an icon to a particular JTable column by specifying my own table cell renderer as below (based on parts of this tutorial): public class MyTableCellRenderer extends DefaultTableCellRenderer { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int r...

Java 1.5 Filter JTable

I would like to filter some rows in a JTable but all the stuff google found me is for java 1.6. I would like to do this using java 1.5 since i can not upgrade? ...

JTable RowFilter

Is is possible to some how get the index of the selection corresponding to the non filtered table? After the table is filter using a regexFilter. JTable getSelectedRow returns the index of the filtered table? ...

Strange blinking of cell on selection with custom Cell Editor

Hi. I am new to working with JTables and having trouble with getting my custom JTable editor to work properly. I have a number of custom panels with lists and buttons. To renderder them in a cell I am using a custom PanelCellRenderer that has various constructors for each type of the panel. To make the buttons clickable I have created...

JTable + TableModel cache fetch event for lazy instantiation?

Scenario: you are using a JTable with a custom TableModel to view the contents of some collection located in a database or on the network or whatever. The brute force way to make this work is to load the whole collection at once. Let's say that isn't practical because of the resources needed. The simple way around that problem is to ...

Select all data when start editing JTable Cell

Hello! I'm trying for a long time to make a table that works like Excell do. It means, when user starts to insert data into the cells the content into them is selected and changed by the new data inserted. I don't know how to do it, I googled it a lot and didn't give any good idea. All the best! ...

Select next cell JTable

Hi, I would like to make a JTable that users when selecting an uneditable cell the it changes the focus to the next editable cell automatically. Important: the user could select a cell by keyboard (tab or arrow) and by mouse clicking. Is it possible?? How to to it? All the Best! ...

How to keep bound JTable up to date?

I am using a bound JTable to display a list of entities. // selSteps is a List of entities. selStepsBound = ObservableCollections.observableList(selSteps); JTableBinding jTableBinding = SwingBindings.createJTableBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, selStepsBound, tblSelSteps, "tblSelStep...

Easy way to fill a JTable with CSV data

I have CSV data (in fact the values are separated by a tab character, but I can use ; as the separator). The data are stored in a String object. Is there simple way to create a JTable with this data (without doing it manually by reading and parsing the String object) ? (note: my project is using Java 1.4, but if you have a solution tha...