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 29 30 31 32 33 34 35 36 37 38 39 40 |
package org.homebrew;
import java.awt.*;
import java.awt.event.*;
import javax.tv.xlet.*;
import org.havi.ui.*;
import org.dvb.ui.*;
public class MyXlet extends Component implements Xlet{
private HScene hs;
Font font;
public void initXlet(XletContext context){
hs= HSceneFactory.getInstance().getFullScreenScene(
HScreen.getDefaultHScreen().getDefaultHGraphicsDevice());
setBounds(hs.getBounds());
hs.add(this);
hs.setVisible(true);
requestFocus();
try{
FontFactory FontF;
FontF= new FontFactory();
font= FontF.createFont("mona", java.awt.Font.PLAIN,12);
}catch(Exception e){
}
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.setFont(font);
g.drawString("合計メモリ:"+Runtime.getRuntime().totalMemory(), 100, 50);
g.drawString("使用量:"+Runtime.getRuntime().freeMemory(), 100, 100);
// g.drawString("最大使用可能メモリ:"+Runtime.getRuntime().maxMemory(), 100, 150);
}
}
|