Writing a string at a given position in a drawing in Codename one

佐手、 提交于 2019-12-07 00:42:26

Components in Codename One are positioned in the X/Y of their parent Container and aren't translated into location. So the 0, 0 position would be getX(), getY().

You can obviously use translate to make 0,0 work for you too.

The x and y coordinates that are passed to the drawRect(x,y,w,h) method are relative to the component’s parent’s origin — not the component itself .. its parent. This is why we the x position is getX()+5 and not just 5.

From the Codename One Developer Guide Graphics section

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!