// Test code for Table ActiveDescendantPropertyChange Event, JDK-8036983, // please run JavaFerret-64.exe in JAB 2.0.4 package, enable Trace Active // Descendent Property Event from there, compile and run this test, // Using Shift+Curson Up and Ctrol+Cursor up/down to select/delelect table cell, // check if the AccessibleContext information in JavaFerret is updated with the // active child's information // For JAB 2.0.4, could be downloaded from http://jre.us.oracle.com/java/re/accessbridge/2.0.4/ import java.awt.*; import java.awt.event.*; import javax.swing.*; class TableTest extends JFrame { private JPanel topPanel; private JTable table; private JScrollPane scrollPane; // Constructor of main frame public TableTest() { // Set the frame characteristics setTitle( "Table ActiveDescendantPropertyChange Test" ); setSize( 600, 300 ); setBackground( Color.gray ); // Create a panel to hold all other components topPanel = new JPanel(); topPanel.setLayout( new BorderLayout() ); getContentPane().add( topPanel ); // Create columns names String columnNames[] = { "Column 1", "Column 2", "Column 3" }; // Create some data String dataValues[][] = { { "a", "b", "c" }, { "1", "2", "3" }, { "MV", "SJ", "SFO" } }; // Create a new table instance table = new JTable( dataValues, columnNames ); // Add the table to a scrolling pane scrollPane = new JScrollPane( table ); topPanel.add( scrollPane, BorderLayout.CENTER ); } /** * Create the GUI and show it. For thread safety, * this method should be invoked from the * event-dispatching thread. */ private static void createAndShowGUI() { // Create an instance of the test application TableTest mainFrame = new TableTest(); mainFrame.setVisible( true ); } public static void main(String[] args) { //Schedule a job for the event-dispatching thread: //creating and showing this application's GUI. javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { createAndShowGUI(); } }); } }