Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to draw rectangular in J2ME by canvas through drawline method
    primarykey
    data
    text
    <p>This is first time I at a question in here.</p> <p>Im new in J2ME, and now im developing a small application, but i get problem when i wanna show data into table. But in J2me not support table there for that i know another way can represent for table such as create table by Canvas or CustomItem.</p> <p>In Canvas i can draw 2 lines something like:</p> <pre><code>----------------------- | | | | </code></pre> <p>but i dont know how can get coordinate of 2 lines remain such as like:</p> <pre><code> | | | | | -------------------------- </code></pre> <p>two draw a rectangular in whole screen, </p> <p>i know drawline method has 4 factors x1,y1,x2,y2.</p> <p>but i can not calculate x point and y point to draw two lines above</p> <p>I need you help me explain or give me example </p> <p>My Code:</p> <pre><code>package test; import javax.microedition.lcdui.Canvas; import javax.microedition.lcdui.Graphics; /** * * @author J2MENewBie */ public class TableCanvasExample extends Canvas { private int cols=3; private int rows =50; protected void paint(Graphics g) { g.setColor(0x94b2ff); g.fillRect(0, 0, this.getWidth(), this.getHeight()); //draw two lines g.setColor(0xf8011e); g.drawLine(0, 0, 0, this.getWidth()); g.drawLine(0, 0, this.getHeight(), 0); } } package test; import javax.microedition.lcdui.Display; import javax.microedition.midlet.*; /** * @author J2ME NewBie */ public class TableCanvasMidlet extends MIDlet { private TableCanvasExample tbcve; public TableCanvasMidlet(){ tbcve = new TableCanvasExample(); } public void startApp() { Display.getDisplay(this).setCurrent(tbcve); } public void pauseApp() { } public void destroyApp(boolean unconditional) { } } </code></pre> <p>P/s: the vertical line doesn't full size i dont know why ???</p> <p>Thank you!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload