09-14-2009 06:23 PM
I want to make a buttonField on Curve 8300 phone like the picuture below shows ;
![]()
And the my code is :
ButtonField_submit = new ButtonField("Login", ButtonField.CONSUME_CLICK) { protected void layout(int width, int height) { setExtent(60, 20); } protected void paint(Graphics graphics) {
graphics.setBackgroundColor(0x7F000000);
graphics.clear();
graphics.setFont(f1); graphics.setColor(Color.WHITE); graphics.setDrawingStyle(DrawStyle.HCENTER, true); super.paint(graphics); } };
But the code above fails to make the button like the picture goes.
My quesition is how to write the paint fucntion to make the button show the blackground like the picture? Thanks.
09-15-2009 02:54 AM
ButtonField_submit = new ButtonField("Login", ButtonField.CONSUME_CLICK) {
protected void layout(int width, int height) {
setExtent(60, 20);
}
protected void paintBackground(Graphics graphics) {graphics.setColor(0x7F000000);
super.paintBackground(graphics);
}
};
please check does this code help you or not ?
09-15-2009 03:37 AM
Also chek the custombuttons sample shipped with the JDE.
And also have a look at this CustomButtonField example.
http://supportforums.blackberry.com/rim/board/mess
Regards
Bikas
09-18-2009 07:52 PM