Find attached a testcase. Upon running, this will bring up a small frame
and a JOptionPane. None of them renders for me, but after some blind
clicking in the option pane it throws exactly this NPE.

Regards, Roman


Am Donnerstag, den 28.07.2011, 20:22 +0200 schrieb Mario Torre:
> 2011/7/28 Artem Ananiev <[email protected]>:
> >
> > +1
> 
> Yeah, I agree with Roman, IllegalStateException sounds like the
> perfect option to me.
> 
> Cheers,
> Mario

import java.awt.*;
import javax.swing.*;

public class TestRMNPE extends JLabel {
    private TestRMNPE(String l) {
	super(l);
    }

    public void paint(Graphics g) {
	setText("Frak");
	JOptionPane.showMessageDialog(null, "Don't do this");
    }
    
    public static void main(String[] args) {
	EventQueue.invokeLater(new Runnable() {
		public void run() {
		    JFrame f = new JFrame();
		    f.add(new TestRMNPE("Test"));
		    f.pack();
		    f.setVisible(true);
		}
	    }
	    );
    }
}

Reply via email to