我知道有几个问题,我无法看到我的问题的解决方案。
我的问题是这样的:How to stop Java from running the entire code with out waiting for Gui input from The user
程序不会等待>详细信息输入它只是初始化Gui类并继续
Whit Netbeans IDE我创建了一个用于解析参数的gui,它具有manny文本字段和一个按钮。
按钮的方法" Traducir"是:
private void jButtonTraducirActionPerformed(java.awt.event.ActionEvent evt) {
// I put the entries in attributes.
documento = this.pathDocumento.getText();
salida = this.pathSalida.getText();
ignoradas = this.pathIgnoradas.getText();
diccionarioDefecto = this.pathDiccionarioDefecto.getText();
diccionarioUser = this.pathDiccionarioUser.getText();
implementacion = this.pathImplementacion.getText();
reverseLocal = this.buttonReverse.isSelected();
// here I would have to do an notifyAll()
}
我有一个名为Main的课程:
menuPrincipal parsing = new menuPrincipal();
parsing.main(null);
// here I would have to do a whait()
对于do whait()和notifyAll(),我必须放入一个同步上下文,但同步什么?我该怎么办?