Olá Pessoal,
Estou querendo fazer uma chamada ao método setVisible(false) de um Shell e em seguida setVisible(true), mas quando faço a segunda chamada ele gera um erro.
Alguém sabe como fazer isto?
Grato,
Vitor
Olá Pessoal,
Estou querendo fazer uma chamada ao método setVisible(false) de um Shell e em seguida setVisible(true), mas quando faço a segunda chamada ele gera um erro.
Alguém sabe como fazer isto?
Grato,
Vitor
Vc poderia postar o seu código e o erro que aparece ?
Vc poderia postar o seu código e o erro que aparece ?
Crio uma instância de uma classe Runnable:
public void run() {
Display display = new Display();
createSShell(display);
sShell.open();
while (!sShell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
em seguida faço os seguintes comandos:
sShell.setVisible(false);
sShell.setVisible(true);
Valew
Tinha esquecido o erro:
Exception in thread "Thread-0" org.eclipse.swt.SWTException: Invalid thread access
at org.eclipse.swt.SWT.error(SWT.java:3374)
at org.eclipse.swt.SWT.error(SWT.java:3297)
at org.eclipse.swt.SWT.error(SWT.java:3268)
at org.eclipse.swt.widgets.Widget.error(Widget.java:435)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:331)
at org.eclipse.swt.widgets.Shell.setVisible(Shell.java:1432)
at cittaeletronica.centroDados.gui.GUIServidor.iniciar(GUIServidor.java:27)
at cittaeletronica.centroDados.gui.CittaSystemTray$1$1.handleEvent(CittaSystemTray.java:51)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
at cittaeletronica.centroDados.gui.CittaSystemTray.run(CittaSystemTray.java:69)
Em que local você chama os setVisible() ? Coloca o código “completo”.
Pra que essa piscada?? se quer só fazer a janela minimizada piscar ou não sie oque mais só o setvisible(true) é suficiente não é?