jxtable

Setting the date format in JXTable cell

倖福魔咒の 提交于 2021-01-29 07:39:51
问题 On this thread I've figured out how to add a JXDatePicker in to a JXTable (or JTable) cell. But I've a small issue now. DatePicker pops up and works fine according to my need. But I can't change the display format of the date in the cell. It shows in the following long format. Eg: Wed Aug 01 00:00:00 IST 2012 But I need it in dd-MMM-yyyy format. I've tried changing the DatePickerCellEditor 's format. It partly works. Which means, now it shows the date according to the set format when that

HyperLinks in JXTable column, populated from database

感情迁移 提交于 2019-12-13 15:00:47
问题 My question is how can I make the hyperlinks from a JXTable column (just for one/specific column) to action like "_blank" links of my default desktop web browser. I use JXTable and a DefaultTableModel, also I call the data from a sqlite database. I made the research on the internet, google, [...] and I found a lot of information which says, If I don't make a mistake: registering a MouseListener to JXTable; generate point object from MouseEvent; get the text via getValueAt ***Note: The column

Column dividers in JTable or JXTable

有些话、适合烂在心里 提交于 2019-12-12 15:23:08
问题 I Have a JTable (or a JXTable to be more precise) with 3 sections of grouped columns I want to divide. I used to have 3 tables which i programmatically linked (the scrollbar position, the sorting, the selection). I used a lot of code to get this linked, and I want to get rid of this. Now I Am switching to 1 JXTable, because there are some things a lot nicer in this table class. I found some (not very satisfying) solutions to almost the same problem. Maybe some one has a good suggestion for me

JXTable column sorting changes between 1.0 and 1.6

走远了吗. 提交于 2019-12-10 21:07:31
问题 I recently updated the SwingX library in an application from version 1.0 to 1.6.2 since we updated to JDK1.6 . I know the sorting has been changed to re-use some of the Core JDK components which were introduced in JDK 1.6 . However, in version 1.0 it was possible to sort a column by clicking on the header, subsequent clicks reverted the sort order, and shift click removed the sorting and reverted back to the original order. After the update to version 1.6.2, the shift click behavior is no

JXTable: use a TableCellEditor and TableCellRenderer for a specific cell instead of the whole column

╄→尐↘猪︶ㄣ 提交于 2019-12-10 10:43:51
问题 I have a JXTable compound of 6 columns and two of them are JCheckBox . I would like to have the following behavior: If the first checkbox is checked, the second checkbox is enabled and can be checked or not. If the first checkbox is unchecked, the second must be disabled and unchecked. I edited an image with Photoshop to show the desired result: For the CheckOne and CheckTwo columns i use a custom TableCellEditor and TableCellRenderer : public class CheckBoxCellEditor extends

Freeze columns in JXTable

限于喜欢 提交于 2019-12-08 05:09:31
问题 I'd like to be able to freeze columns in JXTable just like in Excel spreadsheet and came across this project: xframe-swing's JXTable. Just wondering if there is a tutorial for this project. Note that this is not the same as JXTable in swingx project. Or perhaps there is another way? 回答1: Maybe the Fixed Column Table will do what you want. 来源: https://stackoverflow.com/questions/2800947/freeze-columns-in-jxtable

How to set a JTable column as String and sort as Double?

我只是一个虾纸丫 提交于 2019-12-08 02:02:09
问题 I'm still fairly new to Java and have a question in regards to JTable (more specifically JXTable) and sorting rows by column class with mixed data type... Let me elaborate... I have a JXTable that holds data for a product listing. This table has a column for price which I have set to String.class only so that I can display a price with a '$' prepended. The problem I'm having is when the rows are sorted by price, they are not sorted as Doubles, but rather they are sorted as strings so these

How to set a JTable column as String and sort as Double?

一笑奈何 提交于 2019-12-06 14:22:02
I'm still fairly new to Java and have a question in regards to JTable (more specifically JXTable) and sorting rows by column class with mixed data type... Let me elaborate... I have a JXTable that holds data for a product listing. This table has a column for price which I have set to String.class only so that I can display a price with a '$' prepended. The problem I'm having is when the rows are sorted by price, they are not sorted as Doubles, but rather they are sorted as strings so these values: 89.85, 179.70, 299.40, 478.80 are sorted as: 179.70, 299.40, 478.80, 89.85 (Ascending) and 89.85,

JXTable: use a TableCellEditor and TableCellRenderer for a specific cell instead of the whole column

∥☆過路亽.° 提交于 2019-12-06 08:26:16
I have a JXTable compound of 6 columns and two of them are JCheckBox . I would like to have the following behavior: If the first checkbox is checked, the second checkbox is enabled and can be checked or not. If the first checkbox is unchecked, the second must be disabled and unchecked. I edited an image with Photoshop to show the desired result: For the CheckOne and CheckTwo columns i use a custom TableCellEditor and TableCellRenderer : public class CheckBoxCellEditor extends AbstractCellEditor implements TableCellEditor { private static final long serialVersionUID = 1L; private JCheckBox

Combining JXTable with RXTable

限于喜欢 提交于 2019-12-01 11:47:28
Problem I want the capabilities of JXTable with the "select all on edit" behavior of RXTable . Doing a simple override would be fine but the double click function of the RXTable doesn't work with JXTable. When using the Button Action mode it's fine, but when using F2 or a double click something in JXTable clashes with RXTable and remove the selection so I'm left with default behavior. Is it because of the GenericEditor that it uses internally or is it something else? How can I get JXTable to select all on F2 or double click edit? EDIT: It looks like this only happens when the model has the