1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
|
package testSWT;
import .....
public class SWTShellLeBan {
final Display display = Display.getDefault();
protected Shell shlLeban;
private Text text_3;
private Text text_4;
private Text text_5;
private Text text_6;
private Slider slider_1;
private Button btnNewButton;
private Button btnNewButton_1;
private Button btnClose;
public Shell getShlLeban() {
return shlLeban;
}
public void setShlLeban(Shell shlLeban) {
this.shlLeban = shlLeban;
}
.............
.............
.............
/**
* Launch the application.
* @param args
*/
public static void main(String[] args) {
try {
SWTShellLeBan window = new SWTShellLeBan();
window.open();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Open the window, please!
*/
public void open() {
// Display display = Display.getDefault();
createContents();
shlLeban.open();
shlLeban.layout();
while (!shlLeban.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
}
/**
* Create contents of the window.
*/
protected void createContents() {
///////////////////
// Whole window //
///////////////////
shlLeban = new Shell();
shlLeban.setImage(SWTResourceManager.getImage(SWTShellLeBan.class, "/testSWT/images/guillotine.jpg"));
shlLeban.setBackground(SWTResourceManager.getColor(SWT.COLOR_BLACK));
shlLeban.setSize(540, 371);
shlLeban.setText("=: LeBan := cut them out !");
shlLeban.setLayout(null);
///////////
// Port //
///////////
text_4 = new Text(shlLeban, SWT.NONE);
text_4.setForeground(SWTResourceManager.getColor(SWT.COLOR_INFO_BACKGROUND));
text_4.setFont(SWTResourceManager.getFont("Georgia", 12, SWT.NORMAL));
text_4.setTextLimit(5);
text_4.setBackground(SWTResourceManager.getColor(SWT.COLOR_BLACK));
text_4.setBounds(188, 61, 53, 20);
/////////
// IP //
/////////
text_3 = new Text(shlLeban, SWT.NONE);
text_3.setForeground(SWTResourceManager.getColor(SWT.COLOR_INFO_BACKGROUND));
text_3.setFont(SWTResourceManager.getFont("Georgia", 12, SWT.NORMAL));
text_3.setTextLimit(15);
text_3.setBackground(SWTResourceManager.getColor(SWT.COLOR_BLACK));
text_3.setBounds(37, 61, 146, 20);
.............
.............
............. |
Partager