101102103104105106107
* determine the size of the visible viewport (when the * component being displayed does not implement the Scrollable * interface - for example, a TableHeader). */ void setExtentSize(int width, int height) { _extent = new Dimension(width, height); }
107108109110111112113
} /** Returns the size of the visible part of the view. */ public Dimension getExtentSize() { return new Dimension(_extent); }
4546474849505152535455
public ListPanel(int cols, int rows) { super(); this.rows = rows; this.cols = cols; this.setSize(new Dimension(cols, rows)); jlist = new JList(); jlist.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); jlist.setModel(new DefaultListModel()); jlist.setVisibleRowCount(rows - 2);
105106107108109110111
scrollPane.invalidate(); validate(); } public Dimension minimumSize() { return new Dimension(cols, rows); }