Index: modules/swing/src/test/api/java/common/javax/swing/JFormattedTextField_CommitActionRTest.java =================================================================== --- modules/swing/src/test/api/java/common/javax/swing/JFormattedTextField_CommitActionRTest.java (revision 441015) +++ modules/swing/src/test/api/java/common/javax/swing/JFormattedTextField_CommitActionRTest.java (working copy) @@ -37,26 +37,38 @@ protected void setUp() throws Exception { super.setUp(); - frame = new JFrame(); + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + frame = new JFrame(); + } + }); } protected void tearDown() throws Exception { if (frame != null) { - frame.dispose(); + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + frame.dispose(); + } + }); frame = null; } super.tearDown(); } public void testActionPerformed() throws Exception { - c = new JPanel(); - Container parent = new Panel(); - textField = new JFormattedTextField(" "); - frame.getContentPane().add(c); - c.add(parent); - parent.add(textField); - frame.pack(); - frame.setVisible(true); + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + c = new JPanel(); + Container parent = new Panel(); + textField = new JFormattedTextField(" "); + frame.getContentPane().add(c); + c.add(parent); + parent.add(textField); + frame.pack(); + frame.setVisible(true); + } + }); final Rectangle flag = new Rectangle(); final ActionListener parentListener = new ActionListener() {