tungsten screen size

R

Ricardo Dague

Hi! This is my first program written for the Tungsten E, which has a
320x320 screen. It prints out 160x144, which is a quarter of actual
with extra space around, and the lines drawn are two pixels wide. Is
there a way to get it to fix this?


package hello;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class Hello extends MIDlet {
private Canvas canvas;
public Hello() {
canvas = new Canvas() {
public void paint(Graphics g) {
g.setColor(0);
g.fillRect(0,0,getWidth(),getHeight());
g.setColor(0xffffff);
g.drawString("Pfui! "+getWidth()+"x"+getHeight(), //print size
0,0,Graphics.TOP|Graphics.LEFT);
for(int i = 10; i < getHeight(); i += 10)
g.drawLine(0,i,getWidth(),i); //draw lines
}
public void pointerPressed(int x,int y) {
Hello.this.notifyDestroyed(); //exit
program
}
public void keyPressed(int keyCode) {
Hello.this.notifyDestroyed();
}
};
}
public void startApp() {
Display.getDisplay(this).setCurrent(canvas);
}
public void pauseApp() {
}
public void destroyApp(boolean unc) {
}
}

Thanks,
Ricardo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top