戻る 01.Hello World! 次へ

まずはなんといってもHelloWorldですね^^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
30
package org.homebrew;
	import	java.awt.*;
	import	java.awt.event.*;
	import	javax.tv.xlet.*;
	import	org.havi.ui.*;

public class MyXlet extends Component implements Xlet{
	private HScene hs;

	public void initXlet(XletContext context){
		hs= HSceneFactory.getInstance().getFullScreenScene(
			HScreen.getDefaultHScreen().getDefaultHGraphicsDevice());
		setBounds(hs.getBounds());
		hs.add(this);

		hs.setVisible(true);
		requestFocus();

		repaint();
	}
	public void startXlet(){	}
	public void pauseXlet(){	}
	public void destroyXlet(boolean unconditional){	}

	public void paint(Graphics g){
		g.setColor(new Color(255,255,255));
		g.drawString("Hello World",100,100);
	}
}
以上が最小のHelloWorldソースです。