commit-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commit-cp] [bug #13244] awt: GridBagLayout.addLayoutComponent throws Il


From: Timo Lindfors
Subject: [commit-cp] [bug #13244] awt: GridBagLayout.addLayoutComponent throws IllegalArgumentException
Date: Tue, 31 May 2005 18:12:55 +0000
User-agent: Elinks

URL:
  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=13244>

                 Summary: awt: GridBagLayout.addLayoutComponent throws
IllegalArgumentException
                 Project: classpath
            Submitted by: lindi
            Submitted on: Tue 05/31/05 at 18:12
                Category: classpath
                Severity: 3 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
        Platform Version: None

    _______________________________________________________

Details:

Steps to reproduce:
1. Compile and run the attached testcase

Expected results (sun's java 1.5.0):
1. A window shows up. It has filechooser components and "label0" below them.

Actual results (classpath 2005-05-30):
1. No window is shown and the following exception is thrown:
java.lang.IllegalArgumentException
   at java.awt.GridBagLayout.addLayoutComponent (GridBagLayout.java:132)
   at java.awt.Container.addImpl (Container.java:382)
   at java.awt.Container.add (Container.java:290)
   at gridbag.<init> (gridbag.java:11)
   at gridbag.main (gridbag.java:6)

Testcase:
import javax.swing.*;
import java.io.*;
import java.awt.BorderLayout;
public class gridbag extends JFrame {
        public static void main(String[] args) {
                (new gridbag()).show();
        }
        public gridbag() {
                JFileChooser fileChooser = new JFileChooser();
                JLabel label = new JLabel("label0");
                fileChooser.add(label, BorderLayout.SOUTH);
                fileChooser.showOpenDialog(this);
        }
}

I am not sure if this is a bug. 
http://java.sun.com/j2se/1.4.2/docs/api/java/awt/GridBagLayout.html#addLayoutComponent(java.awt.Component,
java.lang.Object) suggests that the exception must be thrown but sun's own
java does not seem to do that. Should we
1) make classpath not throw the exception and violate the javadoc
or
2) try to fix all free software projects that depend on the incorrect
behavior?







    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=13244>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]