How to add a Button-s in SWT?
- by Krausz Lóránt Szilveszter
Only one "frame" is displayed in the left corner ,but I want a n*n buttons in display .
I'd like to create a table using SWT, the table will include a column with button(s).
private void createButtonPanel() {
GridData gridData = new GridData();
gridData.heightHint = N * imageSize;
gridData.widthHint = N * imageSize;
Composite buttonPanel = new Composite(shell, SWT.NONE);
buttonPanel.setBackground(new Color(display, 140, 140, 100));
buttonPanel.setLayoutData(gridData);
for (int i = 0; i < N; ++i) {
for (int j = 0; i < N; ++i) {
button[i][j] = new Button(buttonPanel, SWT.PUSH);
button[i][j].setSize(imageSize, imageSize);
button[i][j].setImage(null);
}
}
}
If some one know please help me...