jtable

Unknown source of ClassCastException (in JTables)

I'm presently refactoring a JTable which displays a multitude of different types of data. The primary reason for this refactoring is that there a few ClassCastExceptions (the author/friend who wrote the code is off on hiatus), and I can't seem to find where these are originating from. Due to the large codebase, I'm at a loss as to where ...

Footer row in a JTable

What is the best way to put a footer row into a JTable? Does anyone have any sample code to do this? The only approach I've thought of so far is to put a special row into the table model that always get sorted to the bottom. Here is what I ended up with: JTable mainTable = new JTable(mainTableModel); JTable footerTable = new JTable(...

JavaFX component that emulates JTable

I have a large dataset that needs to be displayed for users and looking for Swing's JTable like component in JavaFX. ...

Performing an action after a RowSort operation

I have a JTable and a TableRowSorter which I'd like to perform an operation after a sort is finished. I've been browsing the net, and so far I haven't had much luck. Initially I thought just a RowSorterListener would do the trick, but unfortunately it doesn't perform the operation after the sort is finished. Adding a MouseListener to t...

how to use jtable on netbeans

I just wanna know how to use jtable on netbeans because I'm scruffing along and I could'nt do anything good. please, help me ...

Live sorting of JTable

I've figured out how to get a JTable to be sorted properly, but I can't figure out how to get it to automatically update the sort order when a table cell is changed. Right now, I have this (admittedly long) code, mostly based on that in the Java Tutorial's How to Use Tables. I've highlighted the changes I've made with // ADDED. In this ...

JTable TableModel problem in Java

Hi, I can show my data in a JTable without a problem, but when I want to filter while my app is running, the JTable is not showing me data changes. I searched for it and found a class named TableModel but I can't write my AbstractTableModel. Can anyone show me how I can do this? Personelz.Java package deneme.persistence; import java....

Image not displaying in JTable (Java Swing)

Hi I have created the following code. The problem is the image is not displaying in the JTable column. I extend the DefaultTableModel and override the method getColumnClass. It was suggested this was one way to do it. Any clues? the code is below. //package javaapplication12; import javax.swing.*; public class NewJFrame2 extends...

How to change default stop edit behavior in jtable

When you edit a cell in an jtable the value is made permanent only if the focus is changed or if one hits enter (for example if you change the cell value from "abc" to "xyz" and close the window the edit is lost). How do i make the edit permanent when the user stops editing? I guess we have to update the cell value as the cell value ...

Displaying entity-attribute-value data in JTable?

How can I use a JTable to display & edit attribute properties for entities retrieved from an entity,attribute,value (EAV) store (a relational DBMS)? I know this is a question with a lot of possible answers, so PLEASE look at the requirements I have below before answering. I promise to vote up answers that show you've read & understa...

Only one row editable on JTable

I am trying to make a special kind of jtable. I want the entire table to by default be NOT editable. But when the user clicks a row, then clicks the "Edit" jbutton, that specific row is editable. and once they deslect the row its no longer editable. How would I go about doing this? ...

JTable Column resize isn't working

table.getTableHeader().setResizingAllowed(false); column = table.getColumn(columns[0]); column.setWidth(25); column = table.getColumn(columns[1]); column.setWidth(225); column = table.getColumn(columns[2]); column.setWidth(50); table.doLayout() This refuses to set the columns to their specified widths. Any reason why? ...

JTable not returning selected row correctly

I am working with an extension of the DefaultTableModel as follows: This is the NEW AchievementTableModel after updating it to reflect input from some answers. public AchievementTableModel(Object[][] c, Object[] co) { super(c,co); } public boolean isCellEditable(int r, int c) {return false;} public void replace(Object[][] c, Object[]...

Have a jcombobox filter a jtable

following this tutorial http://www.netbeans.org/kb/docs/java/gui-db-custom.html#enhancements it shows how to use a textbox to filter out the master table. Could anyone instruct me on how to do a similiar thing but use a dropdown to test against a specific column? (ie a dropdown of countries, to filter by the country column? thanks ...

JAVA - Validation in JTable

I am trying to validate a cell in the JTable as soon as the data is entered. I want to make sure that say the correct code is entered in the code column. Could anyone let me know how to do this please? Thanks ...

Problem with Showing Records in Jtable

I am using DefaultTable Model for showing my records in Jtable.But there is a problem like in the picture.When i load jtable its showing like LJava.lang.Object type. NOT in string..How can i solve this. Here is my codes ; EntityManagerFactory emf = Persistence.createEntityManagerFactory("SwingDenemePU"); EntityManager em = emf.createEn...

Tabbing over a JTable component

Hi All I have a panel containing a number of components, one of which is a JTable. When the JTable has focus and the TAB key is pressed, the default behaviour is to move focus from cell to cell within the table. I need to change this to focus on the next component instead i.e. leave the JTable completely. Ctrl-TAB achieves the desired ...

Working with data and a JTable?

I have a JTable that I want to use to display some data (a String and a Boolean in each row). The data is maintained by my own class. Is there some way to bind the data model to the JTable, so that when I add to the model, the JTable is dynamically updated and when I remove something from the model, the row is removed from the JTable? I...

Remove rows from JTable

I want to remove some rows from a JTable. Please help me. ...

putting radio group into JTable

it seems JTable can only allow checkbox. how can i put a radio group into a cell on the JTable? ...