-
Bug
-
Resolution: Fixed
-
P4
-
1.3.0
-
kestrel
-
generic, x86
-
generic, windows_nt
Name: skT88420 Date: 08/25/99
Calling JOptionPane.showInternalMessageDialog has no effect.
No dialog is shown, and the code falls through to the next line.
External dialogs still work OK.
Sample Code:
public class Frame1 extends JFrame {
BorderLayout borderLayout1 = new BorderLayout();
JDesktopPane desktop = new JDesktopPane();
javax.swing.JToolBar jToolBar1 = new javax.swing.JToolBar();
javax.swing.JButton jButton1 = new javax.swing.JButton();
javax.swing.JButton jButton2 = new javax.swing.JButton();
public Frame1() {
try {
jbInit();
}
catch (Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton1_actionPerformed(e);
}
});
this.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(WindowEvent e) {
this_windowClosing(e);
}
});
this.getContentPane().setLayout(borderLayout1);
jButton1.setText("External Dialog");
jButton2.setText("Internal Dialog");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton2_actionPerformed(e);
}
});
this.getContentPane().add(desktop, BorderLayout.CENTER);
this.getContentPane().add(jToolBar1, BorderLayout.NORTH);
jToolBar1.add(jButton1, null);
jToolBar1.add(jButton2, null);
}
void jButton1_actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(this, "This is a test");
System.out.println("This should not show until I click on OK");
}
public static void main(String[] args) {
JFrame f = new Frame1();
f.reshape(50, 50, 500, 300);
f.show();
}
void this_windowClosing(WindowEvent e) {
System.exit(0);
}
void jButton2_actionPerformed(ActionEvent e) {
JOptionPane.showInternalMessageDialog(desktop, "This is a test");
System.out.println("This should not show until I click on OK");
}
}
(Review ID: 94341)
======================================================================
Name: wl91122 Date: 09/02/99
Source code follows:
import java.awt.*;
import javax.swing.*;
public class IFrame extends JFrame
{
public String s;
public IFrame()
{
super("i-Frame");
setSize(400, 200);
show();
setContentPane(new JDesktopPane());
JInternalFrame theFrame = new JInternalFrame("Just a test...");
getContentPane().add(theFrame);
theFrame.show();
theFrame.setBounds(10, 10, 100, 100);
s = JOptionPane.showInternalInputDialog(getContentPane(), "Hello, dialog world!");
}
public static void main(String args[])
{
new IFrame();
}
}
The issue is this: under beta 1.3, the above code snippet runs, but the internal
input dialog doesn't appear, along with any other internal dialog generated by
a JOptionPane. The other JInternalFrame is there in the code to illustrate that
it _is_ possible to create and display other JInternalFrames. Even more jarring
is that at the end of the constructor, (s == null) tests true! Worth noting is that
no exceptions get thrown, either.
(Review ID: 94807)
======================================================================