|
|
|
Re: Label Flashing [message #444675 is a reply to message #444660] |
Wed, 20 October 2004 12:45 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
public class Main {
static int index = 0;
public static void main(String[] args) {
final String[] strings = {"first label contents","contents of second
label"};
Display display = new Display();
Shell shell = new Shell(display);
shell.setBounds(10, 10, 200, 200);
final Label label = new Label(shell, SWT.NONE);
label.setBounds(10,10,180,150);
label.setText(strings[index++ % 2]);
label.addListener(SWT.MouseDown, new Listener() {
public void handleEvent(Event event) {
label.setText(strings[index++ % 2]);
}
});
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
display.dispose();
}
Grant
"Atanas" <ata_vla@yahoo.com> wrote in message
news:cl3u8q$lm0$1@eclipse.org...
> Thank you for the answer. Can you send me your trivial snippet so I can
> test it on my machine?
>
|
|
|
Powered by
FUDForum. Page generated in 0.84763 seconds