tungsten screen size

Discussion in 'Java' started by Ricardo Dague, Nov 8, 2003.

  1. 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
    Ricardo Dague, Nov 8, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. asj
    Replies:
    138
    Views:
    2,407
    William Brogden
    Sep 1, 2003
  2. Replies:
    0
    Views:
    479
  3. Piet
    Replies:
    0
    Views:
    402
  4. Jason Cavett

    Preferred Size, Minimum Size, Size

    Jason Cavett, May 23, 2008, in forum: Java
    Replies:
    5
    Views:
    12,538
    Michael Jung
    May 25, 2008
  5. milton

    Programming palm tungsten t5

    milton, Jul 19, 2005, in forum: ASP .Net Mobile
    Replies:
    0
    Views:
    120
    milton
    Jul 19, 2005
Loading...

Share This Page