I want to make JFrame like JDialog box so user can not go outside the JFrame or parent JFrame. how can i make this. please help me.
This is my code:-
TestBedForm n = new TestBedForm();
JDialog dialog = new JDialog();
dialog.setSize(n.getSize());
dialog.setTitle("Design");
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
dialog.add(n);
dialog.setVisible(true);
Here TestBedForm is JFrame and now i want to open this as JDialog box so what is wrong with this code. can somebody help me.
thanks in advance