Blackberry JAVA DEVELOPMENT ENVIRONMENT - - CRYPTOGRAPHIC SMART CARD DRIVER - DEVELOPMENT GUIDE Anleitung zur Fehlerbehebung Seite 18

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 286
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 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();
}
Seitenansicht 17
1 2 ... 13 14 15 16 17 18 19 20 21 22 23 ... 285 286

Kommentare zu diesen Handbüchern

Keine Kommentare