我想畫上邊框上的複合材料的這樣的代碼:
SWT:控件邊框的顏色是什麼?
final Composite c = new Composite(parent, SWT.NONE);
c.setLayout(new FormLayout());
c.addPaintListener(new PaintListener(){
@Override
public void paintControl(PaintEvent e) {
int x = c.getBounds().x;
int y = c.getBounds().y;
e.gc.setForeground(SWTResourceManager.getColor(0));
e.gc.drawLine(x, y-23, x + c.getBounds().width, y-23);
}
});
,但我怎樣才能使邊界問題相同的外觀&感覺作爲默認的邊界?以及如何獲得複合材料的正確Y座標?
我想複合材料只有頂部邊框,有沒有其他方法可以這樣做?
SWT.COLOR_WIDGET_NORMAL_SHADOW將會使邊框看起來像默認。 – CaiNiaoCoder