import org.eclipse.swt.widgets.*; import org.eclipse.swt.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.events.*; class Program { public static void main(String[] argv) { Display megjelenito = new Display(); Shell felulet = new Shell(megjelenito); felulet.setSize(800, 600); felulet.setText("Elso"); Text text = new Text(felulet, SWT.SINGLE); text.setBounds(100,100, 100,30); text.setBackground(new Color(megjelenito, 200, 200, 200)); Button button = new Button(felulet, SWT.PUSH); button.setBounds(100, 200, 100, 30); button.setText("Nyomj meg"); button.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { } public void widgetSelected(SelectionEvent e) { System.out.println("Lenyomtak"); } }); felulet.open(); while(!felulet.isDisposed()) { if(!megjelenito.readAndDispatch()) megjelenito.sleep(); } megjelenito.dispose(); } }