Which is... |
JList2D is the result of the search for a Swing component, which is to fulfil the following demands:
As data model the ListDatamodel should be used.
After possibility the API of the JList component should be extended
There should be the possibility that
the number of the max. used columns or lines determined;
the sequence of the display (columns or lines first) determined and
to be determined it can whether columns or lines are fixed.
... the Swing component JList2D presented here.
Apart from the
demands specified above JList2D has the still following
characteristics:
Swing 1.1-Kompatible;
can be used in IDE's as JavaBean (the necessary information is contained in of files);
linear lists (with JList) can be represented now with minimum modifications of the code in two dimensions.
The following code fragment is taken from that the demo code:
:
// produce the Object and set the data model JList2D
jList2D = to new JList2D ();
jList2D.setModel (getListModel (false));
// set number of fixed spades
jList2D.setFixed (3);
/** a data model for JList2D supplies */
public DefaultListModel getListModel (boolean empty) {
DefaultListModel dlm = new DefaultListModel ();
if (! empty) {
for (int x = 0; x < mclData.length; x++) {
dlm.addElement (mclData [x ]);
}
}
return dlm;
}