pessoal…
eu quero fazer um HStaticText ficar aparecendo por cima de uma imagem pintada pelo paint() …
nao estou conseguindo fazer, abaixo segue o meu código:
1. import java.awt.Color;
2. import java.awt.Font;
3. import java.awt.Graphics;
4. import java.awt.Image;
5. import java.awt.MediaTracker;
6. import java.awt.Toolkit;
7. import javax.tv.xlet.Xlet;
8. import javax.tv.xlet.XletContext;
9. import javax.tv.xlet.XletStateChangeException;
10. import org.havi.ui.HContainer;
11. import org.havi.ui.HScene;
12. import org.havi.ui.HSceneFactory;
13. import org.havi.ui.HScreen;
14. import org.havi.ui.HStaticText;
15.
16. public class novaImg extends HContainer implements Xlet {
17.
18. private XletContext contexto;
19. private HScene scene;
20. private Image img;
21. private HContainer c;
22. private HStaticText tex;
23.
24. public void cena1() {
25.
26. tex = new HStaticText("Rafaelfhhhhhff");
27. tex.setFont(new Font("tiresias", Font.BOLD, 36));
28. tex.setBounds(10, 300, 600, 80);
29. tex.setForeground(Color.BLACK);
30. tex.setBackground(new Color(45, 45, 45, 0));
31.
32. c = this;
33. c.setBounds(0, 0, 720, 550);
34.
35. scene.add(c);
36. scene.add(tex);
37. scene.setVisible(true);
38.
39. }
40.
41. public void paint(Graphics g) {
42.
43. img = Toolkit.getDefaultToolkit().getImage("b1-2.gif");
44. g.drawImage(img, 50, 300, 240, 200, null);
45.
46. paint(g);
47. }
48.
49. public static void main(String[] args) {
50. }
51.
52. public void destroyXlet(boolean arg0) throws XletStateChangeException {
53.
54. contexto.notifyDestroyed();
55. }
56.
57. public void initXlet(XletContext contexto) throws XletStateChangeException {
58.
59. this.contexto = contexto;
60. scene = HSceneFactory.getInstance().getFullScreenScene(
61. HScreen.getDefaultHScreen().getDefaultHGraphicsDevice());
62. cena1();
63. }
64.
65. public void pauseXlet() {
66. }
67.
68. public void startXlet() throws XletStateChangeException {
69. }
70. }
segue uma imagem anexada mostrando o problema…
se alguem puder me ajudar!..

