Is it possible to select multiple days in toedter's JCalendar? Like I would be able to highlight 2 or 3 days in the calendar and then get the days highlighted after I would trigger an event using a button.
or should i be better off using a JTable for a calendar?
I'd use a one column JTable having a JDateChooserCellEditor and a custom renderer. DemoTable is an example, seen here. The TableModel should contain a List<java.util.Date>, as Date implements Comparable for easy sorting. You can supply an addRow() method in DemoTableModel, which can be invoked in your Add button's handler.
Related
Is it possible to select multiple days in toedter's JCalendar? Like I would be able to highlight 2 or 3 days in the calendar and then get the days highlighted after I would trigger an event using a button.
or should i be better off using a JTable for a calendar?
I'd use a one column JTable having a JDateChooserCellEditor and a custom renderer. DemoTable is an example, seen here. The TableModel should contain a List<java.util.Date>, as Date implements Comparable for easy sorting. You can supply an addRow() method in DemoTableModel, which can be invoked in your Add button's handler.
There are many rows on above showing jtable. I want to filter record by short code. If I type short code like 1234 it should be display only short code 1234 associated row on jtable.
Thanks
You're going to have write the code...Start by checking out how to use tables, in particular sorting and filtering
The basic requirement would be to attach an ActionListener to both the field and button (you can do this from the form editor if you wish).
Within the actionPerformed event handler method, you need to create a RowFilter and apply it to the tables RowSorter.
A table can be configured to automatically create a row sorter by setting the autoCreateRowSorter property to true.
It's all explained nicely in the linked tutorials...
And another example
I am trying to implement a Jtable which includes three check-box tables like this:
Can you tell me how to set a single selection group of checkboxes which only allows 1 selected check-box in a single row at any time?
I know of nothing out-of-the-box for doing this. I´d have a TableModelListener check these columns every time a change is made and call setValueAt on the checkboxes as needed.
Is there any way to load JList on the first column of JTable on click?
The table has zones in the 1st column (with multiple locations in every zone). I want to show zone locations to the user in a list, on zone click.
I am looking for it from 1 and half day. I don't want to put my code here because there is a lot of functionality in my table class.
One approach would be to add a ListSelectionListener to the table, as shown here, and update your ListModel according to the row selected. A JList listens to its own ListModel, so the update should be automatic.
I have a JTable that gets data added to it from another JTable.
Now I want to switch between JTables according to the day selected in a JComboBox.
For example, if I choose Monday I add programs added to it then I select Tuesday from the JComboBox and a fresh JTable appears. If I go to Monday again the programs should still be there (until the program is closed).
How do I create multiple JTables (the JTable remains the same) for the days and let the info remain there until program closure?
Here is an example to show you what I mean:
Filtering the rows in an existing table seems easier. See Sorting and Filtering for how to create a RowFilter, instances of which can be added to a JComboBox and applied in the combo's action listener.