🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #12016

JOptionPane: How should an internal Dialog be opened?

#12016
From: Carlos Javier Castro Pena
Date: Mon, 08 Mar 1999 00:00
72 lines
3298 bytes
I need to open a Dialog,  as an internal frame. I am trying to use the
showInternalDialog() method, but I can't make it work:

int result  = JOptionPane.showInternalConfirmDialog(this, "Delete the
selected record?","Confirm Delete",JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE);

  if ( result == JOptionPane.YES_OPTION) { ...


The exception I get is:

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
com.sun.java.swing.JOptionPane.showInternalOptionDialog(JOptionPane.java:914)

 at
com.sun.java.swing.JOptionPane.showInternalConfirmDialog(JOptionPane.java:860)

 at
com.sun.java.swing.JOptionPane.showInternalConfirmDialog(JOptionPane.java:828)

 at
ittc.phoenix.phclient.datalist.SuperList.deleteButton_actionPerformed(SuperList.java:335)

 at
ittc.phoenix.phclient.datalist.SuperList$5.actionPerformed(SuperList.java:146)

 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)


The problem may be in the ' this ' parameter that corresponds to a
JInteralFrame. If I use a .showConfirmDialog() invocations, I don't get
the exception.
Technical Details
Message-ID: <36E42289.22D6038E@ittc.ukans.edu>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,9939a0cfa715e0ce,start
X-Google-Attributes: gid111d45,public
From: Carlos Javier Castro Pena <jcaspen@ittc.ukans.edu>
Subject: JOptionPane: How should an internal Dialog be opened?
Date: 1999/03/08
Message-ID: <36E42289.22D6038E@ittc.ukans.edu>
X-Deja-AN: 452682377
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