| Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате |
| Форум программистов > Java: GUI и Java FX приложения > JDialog работает до вызова setVisible() |
| Автор: bara 21.8.2010, 12:21 | ||
Создаю простой класс JDialog с таким кодом:
Текс "Before setVisible" выводиться сразу, а все, что после метода setVisible(true), выполняется только после закрытия окна. Что не так? Или так и должно быть? |
| Автор: Sleepy_PIP 21.8.2010, 12:39 |
| вот что говорит документация: JDialog->awt.Dialog setVisible public void setVisible(boolean b) Shows or hides this Dialog depending on the value of parameter b. Overrides: setVisible in class Window Parameters: b - if true, makes the Dialog visible, otherwise hides the Dialog. If the dialog and/or its owner are not yet displayable, both are made displayable. The dialog will be validated prior to being made visible. If false, hides the Dialog and then causes setVisible(true) to return if it is currently blocked. Notes for modal dialogs. setVisible(true): If the dialog is not already visible, this call will not return until the dialog is hidden by calling setVisible(false) or dispose. setVisible(false): Hides the dialog and then returns on setVisible(true) if it is currently blocked. It is OK to call this method from the event dispatching thread because the toolkit ensures that other events are not blocked while this method is blocked. See Also: акцент: setVisible(true): If the dialog is not already visible, this call will not return until the dialog is hidden by calling setVisible(false) or dispose. setVisible(false): Hides the dialog and then returns on setVisible(true) if it is currently blocked. It is OK to call this method from the event dispatching thread because the toolkit ensures that other events are not blocked while this method is blocked. так что вроде бы все правильно, нет? |
| Автор: bara 21.8.2010, 13:53 |
| все ясно, спасибо |