Article View: borland.public.jbuilder.java.swing
Article #11831Problem to display JOptionPane
From: Carlos Javier Castro Pena
Date: Wed, 31 Mar 1999 00:00
Date: Wed, 31 Mar 1999 00:00
58 lines
3007 bytes
3007 bytes
I need to open a modal Dialog inside a DesktopPane. I am tried to use
createInternalFrame() or showInternal ... but I get an exception. A code
example follows, and the exception is at the end. The problem is in the
' this.getContentPane() ' argument. I don't know what I should put
there. The parent of this dialog is a JInternalFrame.
JOptionPane pane = new JOptionPane("This is a test");
JInternalFrame dialog = pane.createInternalFrame(this.getContentPane(),
"title here");
dialog.show();
Exception occurred during event dispatching:
java.lang.IllegalArgumentException: cannot add to layout: constraint
must be a string (or null)
at java.awt.BorderLayout.addLayoutComponent(BorderLayout.java:205)
at java.awt.Container.addImpl(Container.java:319)
at com.sun.java.swing.JLayeredPane.addImpl(JLayeredPane.java:153)
at java.awt.Container.add(Container.java:219)
at
com.sun.java.swing.JOptionPane.createInternalFrame(JOptionPane.java:1055)
at
ittc.phoenix.phclient.dataedit.AgreementEdit.disclosureButton_actionPerformed(AgreementEdit.java:583)
at
ittc.phoenix.phclient.dataedit.AgreementEdit$4.actionPerformed(AgreementEdit.java:253)
at
com.sun.java.swing.AbstractButton.fireActionPerformed(AbstractButton.java:860)
at
com.sun.java.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:895)
at
com.sun.java.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:338)
at
com.sun.java.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:230)
at
com.sun.java.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:156)
at java.awt.Component.processMouseEvent(Component.java:2404)
at java.awt.Component.processEvent(Component.java:2249)
at java.awt.Container.processEvent(Container.java:878)
at java.awt.Component.dispatchEventImpl(Component.java:1781)
at java.awt.Container.dispatchEventImpl(Container.java:923)
at java.awt.Component.dispatchEvent(Component.java:1708)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:1559)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:1463)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:1395)
at java.awt.Container.dispatchEventImpl(Container.java:910)
at java.awt.Window.dispatchEventImpl(Window.java:492)
at java.awt.Component.dispatchEvent(Component.java:1708)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Technical Details
Message-ID:
<37025AE8.FE743E82@ittc.ukans.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,67ed44146065cf36,start X-Google-Attributes: gid111d45,public From: Carlos Javier Castro Pena <jcaspen@ittc.ukans.edu> Subject: Problem to display JOptionPane Date: 1999/03/31 Message-ID: <37025AE8.FE743E82@ittc.ukans.edu> X-Deja-AN: 461228116 Content-Transfer-Encoding: 7bit X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: ITTC - University Of Kansas Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing