Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2003

    Can i use Graphics2D in j2me?

    I don't know whether i can use Graphics2D in j2me?If I can ,where is it?

    anybody can help me?

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    If you want to create a MIDP arcade game or just make graphics, then you must use the Canvas object. Canvas is an abstract class with one abstract method protected abstract void paint(Graphics g), which you need to extend. The parameter gives you a reference to the Graphics object which allows you to put content onto the display.

    example shows how we can draw a line.

    public void paint(Graphics g)
    // draw a line
    //x = begin x coord
    //y = begin y coord

    g.drawLine(x, y, xx, yy);


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts