Using the code listed below, showInternalConfirmDialog always return
the value -1 and disappears as soon as its dialog comes up.
Running on JDK-1.2-V, this code works properly as expected.
import java.awt.*;
import javax.swing.*;
public class Test extends JFrame {
public Test() {
super("Test");
}
public static void main(String args[]) {
Test test = new Test();
test.run(args, System.err, System.out);
}
public void run(String args[], java.io.PrintStream log, java.io.PrintStream out) {
JDesktopPane dp = new JDesktopPane();
JOptionPane op = new JOptionPane();
JInternalFrame iframe = op.createInternalFrame(dp, "iframe");
int result = 0;
setBounds(100, 100, 300, 300);
setVisible(true);
result = op.showInternalConfirmDialog(getContentPane(), "test");
out.println("result: " + Integer.toString(result));
quit();
}
void quit() {
dispose();
System.exit(0);
}
}
kenichi.kurosaki@Japan 1999-07-23