This content has been marked as final. Show 2 replies
¿Which is the reason of drawing a text in front of a rectangle? If you want to paint a button you can use HTextButton class.
And be aware that Xletview has limitations and some Java TV & MHP features are not supported. A better way of testing application is having a decoder conected to your computer (using a video capture card) and to uploading applications directly through a serial cable.
btnAcept.setTextContent("ACEPT", HState.NORMAL_STATE); btnAcept.setLocation(pxBtnAcept, pyBtnAcept); btnAcept.setSize(wBtnAcept, hBtnAcept); btnAcept.setActionCommand("OK"); btnAcept.setBackgroundMode(HVisible.BACKGROUND_FILL);//without this the backgroud won´t be painted btnAcept.setBackground(backColorBtnAcept); btnAcept.setForeground(foreColorBtnAcept);
I hope it will help,
Edited by: apenz on Nov 6, 2008 7:20 AM
Be carefully as XletView is not completly developed, some parts of the HScene object are not implemented (I don't know about push and pop methods) you can see which parts are working or partially working http://www.xletview.org/status/status-0.3.6.html
And if what you want is some color behind your text, using those two elements maybe unnecessary if you want plain colors. The HText object has some methods to change the background as .setBackgroundColor(java.awt.Color c) and .setBackgroundMode(HText.BACKGROUND_FILL) with these methods you can change the background color of the text.
And if you want an image other option is using a HGraphicButton as apenz says. Or maybe you want to integrate a more complex background in the background layer and put things over there.