I have a small program in which an element is drawn and discarded when a drop is executed, I open a dialog (extends Jframe) where some text should be entered. The problem is that I want to wait until this dialog box is closed (in fact, the ok button is pressed so that I can read the data from the text field) than to analyze what the user entered, and based on this I will decide , drop rejected or allowed.
public void drop(DropTargetDropEvent e) {
try{
Popup p = new Popup();
p.setParmeter("enter a new name: ");
p.setVisible(true);
System.out.println("value: " + p.getValue());
repaint();
} else {
e.rejectDrop();
}
}
, . - , JFrame. , p.getValue() , ok. , , - , , , ok, , , . gui, . .