4
* Copyright 2009 Sun Microsystems, Inc., 4150 Network Circle,
5
* Santa Clara, California 95054, U.S.A. All rights reserved.
7
* This library is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Lesser General Public
9
* License as published by the Free Software Foundation; either
10
* version 2.1 of the License, or (at your option) any later version.
12
* This library is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Lesser General Public License for more details.
17
* You should have received a copy of the GNU Lesser General Public
18
* License along with this library; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
package org.jdesktop.swingx.plaf.basic;
24
import java.awt.event.ActionEvent;
25
import java.awt.event.ActionListener;
27
import javax.swing.JButton;
28
import javax.swing.JComponent;
29
import javax.swing.JFrame;
30
import javax.swing.JPanel;
32
import org.jdesktop.swingx.InteractiveTestCase;
33
import org.jdesktop.swingx.JXErrorPane;
34
import org.jdesktop.swingx.JXFrame;
35
import org.jdesktop.swingx.JXTable;
36
import org.jdesktop.swingx.error.ErrorInfo;
40
* @author Jeanette Winzenburg
42
public class BasicErrorPaneUIIssues extends InteractiveTestCase {
44
public static void main(String[] args) {
45
BasicErrorPaneUIIssues test = new BasicErrorPaneUIIssues();
47
test.runInteractiveTests();
48
} catch (Exception e) {
55
public void interactiveDummy() {
56
showWithScrollingInFrame(new JXTable(20, 6), "just a dummy - #1212 is virulent only if not app exited");
59
* Issue #1212-swingx: NullPointerException in BasicErrorPaneUI.initWindow listener
61
public void interactiveNPEAfterChangeLAF() {
62
JComponent pane = new JPanel();
63
JButton showErrorPane = new JButton("show error pane");
64
pane.add(showErrorPane);
65
final JXFrame frame = showInFrame(showErrorPane, "NPE on closing");
66
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
67
showErrorPane.addActionListener(new ActionListener() {
69
public void actionPerformed(ActionEvent e) {
70
JXErrorPane.showDialog(frame, new ErrorInfo("Title",
71
"Message", "Details", null, null, null, null));
74
addStatusMessage(frame, "1. show error, 2. change laf, 3. close frame - NPE");