Thomas Darimont
Erfahrenes Mitglied
Hallo!
Gruß Tom
Code:
/**
*
*/
package de.tutorials;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
/**
* @author Tom
*
*/
public class SWTTransparencyExample {
/**
* @param args
*/
public static void main(String[] args) {
Display display = new Display();
final Shell shell = new Shell(display,SWT.NO_BACKGROUND);
shell.setText("SWTTransparencyExample");
shell.setSize(320, 240);
shell.setLayout(new RowLayout());
Button btn = new Button(shell,SWT.NO_BACKGROUND);
btn.setText("Close");
btn.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e) {
shell.dispose();
}
});
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
}
}
Gruß Tom