0
A
回答
0
在黑莓,你可以通過的情況下,從現場
public class MyField extends Field {
public void layout(int width, int height){
setExtent(width, height); //set the field size
}
public void pain(Graphics g){
//do your own paint here
//g.drawText ("Test", 0, 0);
}
}
擴展你想創建由一個labelField和文本字段的創建自定義組件,我建議你從文本字段
public class InputField extends TextField {
private String _label;
private TextField _text;
public InputField(String label){
_label = label;
}
public void layout(int width, int height){
setExtend(width + 200, height); //just an example, i add 200 pixel for width
//you can get the width of the _label too
//need other functions to get width based on the String
}
//you override how to paint in screen
public void paint(Graphics g){
super.paint(g);
g.drawText (getLeft()-200, getTop(), _label);
}
}
見延伸更多示例 http://supportforums.blackberry.com/t5/Java-Development/Custom-Control/td-p/159699
相關問題
- 1. 黑莓JDE ArrayList?
- 2. 黑莓JDE FieldChangeListener
- 3. 黑莓JDE v5.0
- 4. 用黑莓JDE安裝SqLite
- 5. 黑莓鱈魚簽約無黑莓JDE
- 6. 黑莓JDE的HttpConnection問題
- 7. 如何使用jquery鎖定黑莓手機的觸控板?
- 8. Intellij而不是黑莓JDE
- 9. 黑莓JDE JSON解析?
- 10. 如何在黑莓JDE 5.0.0
- 11. 黑莓JDE GPS getLocation()LocationException
- 12. ObjectListField與圖像黑莓JDE
- 13. 黑莓手機 - 如何動畫自定義字段?
- 14. 黑莓手機上的WebSql
- 15. 黑莓手機的facebook api
- 16. 黑莓手機:如何使用PersistableRIMKeyStore?
- 17. 從黑莓手機使用HttpCore
- 18. 使用黑莓手機上傳圖片
- 19. 黑莓自定義LabelField
- 20. 黑莓手機在黑莓手機中的簽名應用程序?
- 21. 黑莓自定義用戶界面和自定義組件
- 22. 以往的黑莓手機Eclipse插件
- 23. 如何在黑莓手機
- 24. 黑莓手機模擬器
- 25. 黑莓手機間隙
- 26. 黑莓定製手機鎖屏
- 27. 黑莓手機應用程序正在研究黑莓手機平板電腦?
- 28. 在黑莓播放的InputStream視頻JDE
- 29. 黑莓JDE 4.7 - TouchEvent類 - 的getX和getGlobalX
- 30. java.util.Arrays中的黑莓JDE 5.0版開發