Index: src/test/api/java/common/javax/swing/JComponentRTest.java =================================================================== --- src/test/api/java/common/javax/swing/JComponentRTest.java (revision 451215) +++ src/test/api/java/common/javax/swing/JComponentRTest.java (working copy) @@ -20,9 +20,13 @@ */ package javax.swing; +import java.awt.Dimension; import java.awt.event.ActionListener; +import junit.framework.AssertionFailedError; + public class JComponentRTest extends BasicSwingTestCase { + Throwable err = null; public void testComponentInstantiation() throws Exception { Object result = (ActionListener)new JComboBox(); result = JPanel.class; @@ -37,4 +41,30 @@ JComponent c = new JComponent() {}; c.resetKeyboardActions(); } + + public void testSetBounds() throws Throwable { + final JFrame jf = new JFrame("test"); + final JComponent comp = new JInternalFrame(); + jf.getContentPane().add(comp); + jf.setSize(200, 200); + final Dimension compSize = new Dimension(50, 500); + jf.show(); + comp.setSize(compSize); + + SwingUtilities.invokeAndWait(new Runnable() { + + public void run() { + try { + assertEquals(compSize, comp.getSize()); + } catch (AssertionFailedError e) { + err = e; + } + jf.dispose(); + } + + }); + if (err != null) { + throw err; + } + } }