I'm showing up a Dialog from a JFrame, but when I click outside the dialog, the dialog gets hidden. It's supposed to the dialog won't let you do nothing unless you close it right?
This is my code:
The Dialog calling from First Dialog:
JProductStocking jps = JProductStocking.getProductStoking(JPanelTicket.this, oApp);
jps.setVisible(true);
And this is the JDIalog called:
public class JProductStocking extends javax.swing.JDialog implements BeanFactoryApp{
public JProductStocking(Component parent, boolean modal) {
//super(parent, modal);
initComponents();
}
public static JProductStocking getProductStoking(Component parent, AppView app) {
Window window = getWindow(parent);
JProductStocking myMsg;
if (window instanceof JFrame) {
myMsg = new JProductStocking((Frame) window, true);
} else {
myMsg = new JProductStocking((Dialog) window, true);
}
myMsg.init(app, parent);
myMsg.applyComponentOrientation(parent.getComponentOrientation());
return myMsg;
}
private static Window getWindow(Component parent) {
if (parent == null) {
return new JFrame();
} else if (parent instanceof JFrame || parent instanceof Dialog) {
return (Window) parent;
} else {
return getWindow(parent.getParent());
}
}
public void init(AppView app, Component parent) {
oApp = app;
// m_dlSales = (DataLogicSales) app.getBean("com.openbravo.pos.forms.DataLogicSales");
initComponents();
ProductList = new ArrayList();
this.setResizable(false);
setLocationRelativeTo(parent);
}
}
Im not calling the jDialog well? or what im doing wrong?