public void testGridBagSpacer() throws Exception {
    JPanel panel = (JPanel) getInstrumentedRootComponent("TestGridBagSpacer.form", "BindingTest");
    assertTrue(panel.getLayout() instanceof GridBagLayout);
    assertTrue(panel.getComponent(0) instanceof JLabel);
    assertTrue(panel.getComponent(1) instanceof JPanel);

    GridBagLayout gridBag = (GridBagLayout) panel.getLayout();
    GridBagConstraints gbc = gridBag.getConstraints(panel.getComponent(0));
    assertEquals(0.0, gbc.weightx, 0.01);
    assertEquals(0.0, gbc.weighty, 0.01);
    gbc = gridBag.getConstraints(panel.getComponent(1));
    assertEquals(0.0, gbc.weightx, 0.01);
    assertEquals(1.0, gbc.weighty, 0.01);
  }
 public void testGridBagLayout() throws Exception {
   JPanel panel = (JPanel) getInstrumentedRootComponent("TestGridBag.form", "BindingTest");
   assertTrue(panel.getLayout() instanceof GridBagLayout);
   GridBagLayout gridBag = (GridBagLayout) panel.getLayout();
   JButton btn = (JButton) panel.getComponent(0);
   GridBagConstraints gbc = gridBag.getConstraints(btn);
   assertNotNull(gbc);
   assertEquals(2, gbc.gridheight);
   assertEquals(2, gbc.gridwidth);
   assertEquals(1.0, gbc.weightx, 0.01);
   assertEquals(new Insets(1, 2, 3, 4), gbc.insets);
   assertEquals(GridBagConstraints.HORIZONTAL, gbc.fill);
   assertEquals(GridBagConstraints.NORTHWEST, gbc.anchor);
 }