Code example for AtomicInteger

Methods: intValue

0
            throw new RuntimeException("Test failed");
        } 
    } 
 
    private static int getSelectedRow() throws Exception { 
        final AtomicInteger row = new AtomicInteger(-1);
        SwingUtilities.invokeAndWait(new Runnable() {
            @Override 
            public void run() { 
                row.set(table.getSelectedRow());
            } 
        }); 
        return row.intValue();
    } 
 
    private static void doTest() throws Exception { 
        toolkit.realSync();
 
        robot.keyPress(KeyEvent.VK_PAGE_DOWN);
        robot.keyRelease(KeyEvent.VK_PAGE_DOWN);
        toolkit.realSync();