189 * J2SE 5 adds methods to <code>JTable</code> to provide convenient access to some
190 * common printing needs. Simple new {@link #print()} methods allow for quick
191 * and easy addition of printing support to your application. In addition, a new
192 * {@link #getPrintable} method is available for more advanced printing needs.
193 * <p>
194 * As for all <code>JComponent</code> classes, you can use
195 * {@link InputMap} and {@link ActionMap} to associate an
196 * {@link Action} object with a {@link KeyStroke} and execute the
197 * action under specified conditions.
198 * <p>
199 * <strong>Warning:</strong> Swing is not thread safe. For more
200 * information see <a
201 * href="package-summary.html#threading">Swing's Threading
202 * Policy</a>.
203 * <p>
204 * <strong>Warning:</strong>
205 * Serialized objects of this class will not be compatible with
206 * future Swing releases. The current serialization support is
207 * appropriate for short term storage or RMI between applications running
208 * the same version of Swing. As of 1.4, support for long term storage
209 * of all JavaBeans™
210 * has been added to the <code>java.beans</code> package.
211 * Please see {@link java.beans.XMLEncoder}.
212 *
213 * @author Philip Milne
214 * @author Shannon Hickey (printing support)
215 * @see javax.swing.table.DefaultTableModel
216 * @see javax.swing.table.TableRowSorter
217 * @since 1.2
218 */
219 /* The first versions of the JTable, contained in Swing-0.1 through
220 * Swing-0.4, were written by Alan Chung.
221 */
222 @JavaBean(defaultProperty = "UI", description = "A component which displays data in a two dimensional grid.")
223 @SwingContainer(false)
224 @SuppressWarnings("serial") // Same-version serialization only
225 public class JTable extends JComponent implements TableModelListener, Scrollable,
226 TableColumnModelListener, ListSelectionListener, CellEditorListener,
227 Accessible, RowSorterListener
228 {
229 //
6634 if (accessibleContext == null) {
6635 accessibleContext = new AccessibleJTable();
6636 }
6637 return accessibleContext;
6638 }
6639
6640 //
6641 // *** should also implement AccessibleSelection?
6642 // *** and what's up with keyboard navigation/manipulation?
6643 //
6644 /**
6645 * This class implements accessibility support for the
6646 * <code>JTable</code> class. It provides an implementation of the
6647 * Java Accessibility API appropriate to table user-interface elements.
6648 * <p>
6649 * <strong>Warning:</strong>
6650 * Serialized objects of this class will not be compatible with
6651 * future Swing releases. The current serialization support is
6652 * appropriate for short term storage or RMI between applications running
6653 * the same version of Swing. As of 1.4, support for long term storage
6654 * of all JavaBeans™
6655 * has been added to the <code>java.beans</code> package.
6656 * Please see {@link java.beans.XMLEncoder}.
6657 */
6658 @SuppressWarnings("serial") // Same-version serialization only
6659 protected class AccessibleJTable extends AccessibleJComponent
6660 implements AccessibleSelection, ListSelectionListener, TableModelListener,
6661 TableColumnModelListener, CellEditorListener, PropertyChangeListener,
6662 AccessibleExtendedTable {
6663
6664 int previousFocusedRow;
6665 int previousFocusedCol;
6666
6667 /**
6668 * AccessibleJTable constructor
6669 *
6670 * @since 1.5
6671 */
6672 protected AccessibleJTable() {
6673 super();
6674 JTable.this.putClientProperty("JTable.forceAutoStartsEdit", true);
|
189 * J2SE 5 adds methods to <code>JTable</code> to provide convenient access to some
190 * common printing needs. Simple new {@link #print()} methods allow for quick
191 * and easy addition of printing support to your application. In addition, a new
192 * {@link #getPrintable} method is available for more advanced printing needs.
193 * <p>
194 * As for all <code>JComponent</code> classes, you can use
195 * {@link InputMap} and {@link ActionMap} to associate an
196 * {@link Action} object with a {@link KeyStroke} and execute the
197 * action under specified conditions.
198 * <p>
199 * <strong>Warning:</strong> Swing is not thread safe. For more
200 * information see <a
201 * href="package-summary.html#threading">Swing's Threading
202 * Policy</a>.
203 * <p>
204 * <strong>Warning:</strong>
205 * Serialized objects of this class will not be compatible with
206 * future Swing releases. The current serialization support is
207 * appropriate for short term storage or RMI between applications running
208 * the same version of Swing. As of 1.4, support for long term storage
209 * of all JavaBeans
210 * has been added to the <code>java.beans</code> package.
211 * Please see {@link java.beans.XMLEncoder}.
212 *
213 * @author Philip Milne
214 * @author Shannon Hickey (printing support)
215 * @see javax.swing.table.DefaultTableModel
216 * @see javax.swing.table.TableRowSorter
217 * @since 1.2
218 */
219 /* The first versions of the JTable, contained in Swing-0.1 through
220 * Swing-0.4, were written by Alan Chung.
221 */
222 @JavaBean(defaultProperty = "UI", description = "A component which displays data in a two dimensional grid.")
223 @SwingContainer(false)
224 @SuppressWarnings("serial") // Same-version serialization only
225 public class JTable extends JComponent implements TableModelListener, Scrollable,
226 TableColumnModelListener, ListSelectionListener, CellEditorListener,
227 Accessible, RowSorterListener
228 {
229 //
6634 if (accessibleContext == null) {
6635 accessibleContext = new AccessibleJTable();
6636 }
6637 return accessibleContext;
6638 }
6639
6640 //
6641 // *** should also implement AccessibleSelection?
6642 // *** and what's up with keyboard navigation/manipulation?
6643 //
6644 /**
6645 * This class implements accessibility support for the
6646 * <code>JTable</code> class. It provides an implementation of the
6647 * Java Accessibility API appropriate to table user-interface elements.
6648 * <p>
6649 * <strong>Warning:</strong>
6650 * Serialized objects of this class will not be compatible with
6651 * future Swing releases. The current serialization support is
6652 * appropriate for short term storage or RMI between applications running
6653 * the same version of Swing. As of 1.4, support for long term storage
6654 * of all JavaBeans
6655 * has been added to the <code>java.beans</code> package.
6656 * Please see {@link java.beans.XMLEncoder}.
6657 */
6658 @SuppressWarnings("serial") // Same-version serialization only
6659 protected class AccessibleJTable extends AccessibleJComponent
6660 implements AccessibleSelection, ListSelectionListener, TableModelListener,
6661 TableColumnModelListener, CellEditorListener, PropertyChangeListener,
6662 AccessibleExtendedTable {
6663
6664 int previousFocusedRow;
6665 int previousFocusedCol;
6666
6667 /**
6668 * AccessibleJTable constructor
6669 *
6670 * @since 1.5
6671 */
6672 protected AccessibleJTable() {
6673 super();
6674 JTable.this.putClientProperty("JTable.forceAutoStartsEdit", true);
|