When my application is runing and there popup a meaasge dialog box(JOptionPane.showMessageDialog(......)). If I select some other window in the screen the message box sent to back. How can I avoid that.
The first parameter of a JOptionPane should be the parent component. Usually this is the JFrame from which it was launched. You are probably specifying null for this argument.
sairam sam
Greenhorn
Joined: Apr 15, 2005
Posts: 10
posted
0
Sham, As Gregg said ur passing null value to the first parameter of the JOptionPane... below is simple static method from my util class...which i use for the model dialog...on any module screens which basically extends the JPanel.
public static Frame findParentFrame(JPanel pan) { Component c = pan.getParent(); while(true) { if(c instanceof Frame) return (Frame)c; c = c.getParent(); } }
Sai.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.