New client property to control the "today” button action behavior
JCalendar works with AComboBox and add new calendar popup icon.
1. New property to control the action click count
JCalendar provides new property named “actionClickCount” since JComponentPack 1.1.0, use this property, you can set the mouse click count to fire the action event, JCalendar adds the following methods:
JCalendar.getActionClickCount();
JCalendar.setActionClickCount(int);
2. New client property to control the "today” button action behavior
With this new client property “JCalendar.todayButtonFireActionEventEnabled” since JComponentPack 1.1.0, the JCalendar can fire the action event when the today button clicked.
The above new features is very important when JCalendar working with
the AComboBox, the the popup JCalendar make visible, by using the above
property, the popup can hidden when use click a "today” button or
select a specified day.
3. JCalendar works with AComboBox and add new calendar popup icon.
When AComBoBox set a Date value , the popup icon automatically became a calendar icon, this is a nice feature since JComponentPack 1.1.0, see the screenshot for this feature:
If you want to implements the Windows explorer like feature in Java swing application, the JListViewcomponent meets your requirements exactly.
The JListViewcomponent
support the 5 different view modes: small icon, large icon, list,
thumbnails, details, all these view mode can change on the fly, the
methods “JListView.setViewMode” can change the view mode of JListViewcomponent.
The JListViewcomponent use a ListSelectionModelas
it’s selection model, you can change the selection model’s mode, it
support single selection, single interval selection, multiple interval
selection, you can use the following methods to get the selected values:
The JListViewcomponent also support row sorting, the TableModelyou provided for JListViewonly need implements the ColumnSorter interface, it can support the row sorting automatically, we want to improve this area after upgrade the JRE version to 1.6.
The JListViewcomponent provides several important client property:
For details, you can view the JListViewJavaDoc API documentation.
The JListViewalso support the Drag and Drop, but in JComponentPack 1.1.0 and early version, implements this feature has trick and tips:
// get JTable and JList
BasicListViewUI ui = (BasicListViewUI)listView.getUI();
JTable table = ui.getTable();
JList list = ui.getList();
table.setDragEnabled(true);
list.setDragEnabled(true);
TransferHandler th = new TransferHandler() {
public int getSourceActions(JComponent c) {
return COPY;
}
protected Transferable createTransferable(JComponent c) {
// just a test
Object o = listView.getSelectedValue();
if(o != null) {
return new StringSelection(o.toString());
}
return null;
}
};
table.setTransferHandler(th);
list.setTransferHandler(th);
In the upcoming version JComponentPack 1.2.0, we have improved this area, so in the new version, implements the drag and drop feature is very simple:
listView.setDragEnabled(true);
TransferHandler th = new TransferHandler() {
public int getSourceActions(JComponent c) {
return COPY;
}
protected Transferable createTransferable(JComponent c) {
// just a test
Object o = listView.getSelectedValue();
if(o != null) {
return new StringSelection(o.toString());
}
return null;
}
};
listView. setTransferHandler(th);
The JListViewcomponent
support the 5 different view modes: small icon, large icon, list,
thumbnails, details, all these view mode can change on the fly, the
methods “JListView.setViewMode” can change the view mode of JListViewcomponent.
The JListViewcomponent use a ListSelectionModelas
it’s selection model, you can change the selection model’s mode, it
support single selection, single interval selection, multiple interval
selection, you can use the following methods to get the selected values:
The JListViewcomponent also support row sorting, the TableModelyou provided for JListViewonly need implements the ColumnSorter interface, it can support the row sorting automatically, we want to improve this area after upgrade the JRE version to 1.6.
The JListViewcomponent provides several important client property:
For details, you can view the JListViewJavaDoc API documentation.
The JListViewalso support the Drag and Drop, but in JComponentPack 1.1.0 and early version, implements this feature has trick and tips:
// get JTable and JList
BasicListViewUI ui = (BasicListViewUI)listView.getUI();
JTable table = ui.getTable();
JList list = ui.getList();
table.setDragEnabled(true);
list.setDragEnabled(true);
TransferHandler th = new TransferHandler() {
public int getSourceActions(JComponent c) {
return COPY;
}
protected Transferable createTransferable(JComponent c) {
// just a test
Object o = listView.getSelectedValue();
if(o != null) {
return new StringSelection(o.toString());
}
return null;
}
};
table.setTransferHandler(th);
list.setTransferHandler(th);
In the upcoming version JComponentPack 1.2.0, we have improved this area, so in the new version, implements the drag and drop feature is very simple:
listView.setDragEnabled(true);
TransferHandler th = new TransferHandler() {
public int getSourceActions(JComponent c) {
return COPY;
}
protected Transferable createTransferable(JComponent c) {
// just a test
Object o = listView.getSelectedValue();
if(o != null) {
return new StringSelection(o.toString());
}
return null;
}
};
listView. setTransferHandler(th);