×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jun 2012
    Posts
    4

    Graphics in j2me

    Hi

    In my application i imported 1 jar file,in that i have one class file with method name Drawscreen(graphics g).No i want this method to be called from my Mainapplication startapp().But i can't call that method because graphics(g) is not supported.Anybody can please help me.

  2. #2
    Nokia Developer Expert
    Join Date
    May 2012
    Posts
    224

    Re: Graphics in j2me

    Hi subbuohile,

    you mean how to get Graphics object and pass that object to your ownclass.Drawscreen(graphics g) method? if yes, you can create image with screen height and width, and get the graphics from image like below
    Image image = Image.createImage(getWidth(), getHeight());
    Graphics g = image.getGraphics();

  3. #3
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: Graphics in j2me

    Quote Originally Posted by subbuohile View Post
    Hi

    In my application i imported 1 jar file,in that i have one class file with method name Drawscreen(graphics g).No i want this method to be called from my Mainapplication startapp().But i can't call that method because graphics(g) is not supported.Anybody can please help me.
    In your application startapp(), you create a class that extends Canvas, and you will get he graphics Object g inside the paint() method of your Canvas class. Now call Drawscreen(g) and your screen will be painted by the jar file drawscreen class.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

Similar Threads

  1. J2me Graphics Bug or something?
    By bakhshi in forum Mobile Java General
    Replies: 8
    Last Post: 2009-08-27, 05:44
  2. Graphics in j2me..pls help
    By smartss in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2007-03-19, 10:12
  3. Graphics in j2me
    By smartss in forum Mobile Java General
    Replies: 2
    Last Post: 2007-03-18, 12:06
  4. graphics for j2me
    By peter_73 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 7
    Last Post: 2003-11-18, 06:05
  5. Graphics in J2ME
    By zivgr in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2003-05-06, 11:49

Posting Permissions

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