×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Mar 2010
    Posts
    87

    adding SCREEN command to canvas clas

    Hello,
    what if i want to add SCREEN command to canvas class. following is a canvas class. please add any SCREEN command to it. THanks in advance

    PHP Code:
    class canvasGraphicalIncomes extends Canvas {


       public 
    void paint(Graphics g) {

    //clear the previous display
    g.setColor(255255255); // White
    g.fillRect(00getWidth(), getHeight());

     
    g.setColor(199,199,199);
     
    g.fillRect(210,40,2010); 

     
    g.setColor(255,255,155);
     
    g.fillRect(210,70,2010); 

     
    g.setColor(255,0,0);
     
    g.fillRect(210,100,2010); 

     
    g.setColor(0,255,0);
     
    g.fillRect(210,130,2010); 

     
    g.setColor(0,0,255);
     
    g.fillRect(210,160,2010); 

    Font f Font.getFont(Font.FACE_PROPORTIONALFont.STYLE_BOLD,Font.SIZE_MEDIUM);
    g.setFont(f);
    g.drawString("Income's Statistics"3500); 


     
    Font.getFont(Font.FACE_PROPORTIONALFont.STYLE_PLAIN,Font.SIZE_SMALL); //setting fornt to normal
    g.setFont(f);
    g.setColor(0,0,0);
    g.drawString("Gift"200500);
    g.drawString("Incidental earnings"150800);
    g.drawString("Interest"2001100);
    g.drawString("Rent"2001400);
    g.drawString("Salary"2011700);
    g.drawString("Press Exit Button to quit"122300);
          
       }


  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: adding SCREEN command to canvas clas

    Quote Originally Posted by apnasi View Post
    Hello,
    what if i want to add SCREEN command to canvas class. following is a canvas class. please add any SCREEN command to it. THanks in advance

    PHP Code:
    class canvasGraphicalIncomes extends Canvas {

        
    Command c = new Command("Hello"Command.SCREEN1);
       public 
    void paint(Graphics g) {

    //clear the previous display
    g.setColor(255255255); // White
    g.fillRect(00getWidth(), getHeight());

     
    g.setColor(199,199,199);
     
    g.fillRect(210,40,2010); 

     
    g.setColor(255,255,155);
     
    g.fillRect(210,70,2010); 

     
    g.setColor(255,0,0);
     
    g.fillRect(210,100,2010); 

     
    g.setColor(0,255,0);
     
    g.fillRect(210,130,2010); 

     
    g.setColor(0,0,255);
     
    g.fillRect(210,160,2010); 

    Font f Font.getFont(Font.FACE_PROPORTIONALFont.STYLE_BOLD,Font.SIZE_MEDIUM);
    g.setFont(f);
    g.drawString("Income's Statistics"3500); 


     
    Font.getFont(Font.FACE_PROPORTIONALFont.STYLE_PLAIN,Font.SIZE_SMALL); //setting fornt to normal
    g.setFont(f);
    g.setColor(0,0,0);
    g.drawString("Gift"200500);
    g.drawString("Incidental earnings"150800);
    g.drawString("Interest"2001100);
    g.drawString("Rent"2001400);
    g.drawString("Salary"2011700);
    g.drawString("Press Exit Button to quit"122300);
            
    this.addCommand(c);
          
       }

    Check this code.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

Similar Threads

  1. two canvas on a single screen
    By Manish_Bansal in forum Mobile Java Networking & Messaging & Security
    Replies: 9
    Last Post: 2010-04-09, 05:52
  2. Adding Multiple TextBox in Canvas
    By junedahmed in forum Mobile Java General
    Replies: 3
    Last Post: 2010-03-20, 10:44
  3. Want to show the update screen
    By sweetsweet24 in forum Mobile Java General
    Replies: 2
    Last Post: 2008-11-28, 06:54
  4. UI: Full Screen Mode
    By GENERAL_INFO in forum Symbian User Interface
    Replies: 3
    Last Post: 2004-11-22, 06:27
  5. why no status pane in Canvas Screen?
    By xrsu in forum Mobile Java General
    Replies: 1
    Last Post: 2002-10-29, 08:51

Posting Permissions

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