Blackberry JAVA DEVELOPMENT ENVIRONMENT - - CRYPTOGRAPHIC SMART CARD DRIVER - DEVELOPMENT GUIDE Guía para resolver problemas Pagina 18

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 286
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 17
18
BlackBerry Java Development Environment Development Guide
Create a custom field
Task Steps
Create a custom field. You can only add custom context menu items and custom layouts to a custom field.
> Extend the Field class, or one of its subclasses, implementing the DrawStyle interface to specify the
characteristics of the custom field and turn on drawing styles.
public class CustomButtonField extends Field implements DrawStyle {
public static final int RECTANGLE = 1;
public static final int TRIANGLE = 2;
public static final int OCTAGON = 3;
private String _label;
private int _shape;
private Font _font;
private int _labelHeight;
private int _labelWidth;
}
Define the label, shape,
and style of the custom
button.
> Implement constructors to define the label, shape, and style of the custom button.
public CustomButtonField(String label) {
this(label, RECTANGLE, 0);
}
public CustomButtonField(String label, int shape) {
this(label, shape, 0);
}
public CustomButtonField(String label, long style) {
this(label, RECTANGLE, style);
}
public CustomButtonField(String label, int shape, long style) {
super(style);
_label = label;
_shape = shape;
_font = getFont();
_labelHeight = _font.getHeight();
_labelWidth = font.getWidth();
}
Vista de pagina 17
1 2 ... 13 14 15 16 17 18 19 20 21 22 23 ... 285 286

Comentarios a estos manuales

Sin comentarios