Skip to main content

JXErrorPane Dialog is not always closing after a FATAL error

Please note these forums are being decommissioned and use the new and improved forums at
No replies
Joined: 2008-11-20

On closing a JXErrorPane-Dialog the surrounding application should be closed too, if an ErrorLevel of FATAL is given to it.
This works as expected if I click on the Window-Close-Icon or if I select close from the Dialog-Icon-Menu. But the application is not closed after clicking on the JX-ErrorPane-Button labeled "Exit Application".

Here is some code to reproduce the problem:

public class ErrorPaneDemo extends JPanel
public ErrorPaneDemo()
ErrorInfo info =
new ErrorInfo( "title", "basic error message", null, "category", new Exception(), ErrorLevel.FATAL,
null );
JXErrorPane.showDialog( null, info );
add( new JLabel( "it goes on and on and on..." ) );//This is shown in a frame if the application is not System.exited

public static void main( String[] args )
SwingUtilities.invokeLater( new Runnable()
public void run()
JFrame frame = new JFrame();
frame.getContentPane().add( new ErrorPaneDemo() );
frame.setPreferredSize( new Dimension( 800, 600 ) );
frame.setLocationRelativeTo( null );
frame.setVisible( true );
} );

I found the method exitIfFatal() in the BasicErrorPaneUI. Is it a bug that this method is not called by the button-action? How could I fix this?