public class Test { public void method(){ int i; Button h[]=new Button [9]; int dx[]={1,2,3,4,5,6,7,8,9}; int dy[]={1,1,1,1,1,1,1,1,1}; String st[]={"aa","ii","uu","ee","oo","か","き","く","け"};
Display display = new Display(); Shell shell=new Shell(display); shell.open();
for(i=0; i<9; i++){ h[i]=new Button(shell,SWT.BORDER); h[i].setBounds(dx[i]*50,dy[i]*30,50,30); if(i!=4){h[i].setText(st[i]);}} while(!shell.isDisposed()){if(!display.readAndDispatch()){display.sleep();}} display.dispose();} public static void main(String[] args){ Test test = new Test(); test.method();}}