| Setting specific background and border colors to buttons [message #1007718] |
Thu, 07 February 2013 04:58  |
K C Messages: 1 Registered: February 2013 |
Junior Member |
|
|
We use RAP 1.2 as our GUI based engine. I have been asked to set the colors of the background (to #8FA8BF) and border(to #7B92AB) and also the text (to #FFFFFF).
I tried the following code in a sub-class of org.eclipse.swt.widgets.Button:
public class Button extends org.eclipse.swt.widgets.Button {
public Button(Composite parent, int style) {
super(parent, style);
this.addPaintListener(new PaintListener() {
public void paintControl(PaintEvent e) {
Color buttonColor = new Color(e.display, 143, 168, 91);
e.gc.setBackground(buttonColor);
buttonColor.dispose();
}
});
}
}
Is this the right approach? In my Eclipse, when I attach the 3.5 SWT jars, then it compiles. But, when I try to compile it using our build (Ant based), which uses the RAP 1.2 plugins, then it fails to recognize PaintListener, PaintEvent and also the addPaintListener method. What am I doing wrong?
|
|
|