KickJava   Java API By Example, From Geeks To Geeks.

Java > Java SE, EE, ME > javax > microedition > lcdui > Graphics

javax.microedition.lcdui
Class Graphics

java.lang.Object
  |
  +--javax.microedition.lcdui.Graphics
See Also:
Source Code, getHeight(), stringWidth(), setClip(), getClipHeight(), getClipWidth(), getClipY(), getClipX(), translate(), setStrokeStyle(), drawSubstring(), drawString(), drawChars(), drawChar(), getGraphics(), paint(), drawRegion(), drawImage(), getDisplayColor(), Display

public static final int BASELINE
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[1465]Draw a smiley face
By Anonymous on 2005/06/29 02:35:47  Rate
import javax.microedition.midlet.*; 
 import javax.microedition.lcdui.*; 
  
  
 public class Face extends Canvas 
  {  
   public void paint ( Graphics g )   
    {    
     int i,k; 
     g.drawOval ( 40,40,120,150 ) ; 
     g.drawOval ( 57,75,30,20 ) ; 
     g.drawOval ( 110,75,30,20 ) ; 
     g.setColor ( Color.yellow ) ; 
     g.fillOval ( 58,76,29,19 ) ; 
     g.fillOval ( 111,76,29,19 ) ; 
     g.setColor ( Color.black ) ; 
     g.fillOval ( 68,81,10,10 ) ; 
     g.fillOval ( 121,81,10,10 ) ; 
     g.drawArc ( 59,124,81,41,180,180 ) ;//mouth 
     //g.drawArc ( 70,124,81,41,180,180 ) ;//mouth 
     g.setColor ( Color.red ) ; 
     g.fillArc ( 60,125,80,40,180,180 ) ;//mouth 
     g.setColor ( Color.blue ) ; 
     g.fillOval ( 85,103,15,15 ) ; 
         g.fillOval ( 100,103,15,15 ) ; 
     g.fillOval ( 93,115,14,25 ) ; 
     /*k=1; 
     while ( k < 10000000 )  
      {  
       if ( k%100==0 )  
        {  
     for  ( i=5;i < =15;i++  )  
      {  
     g.fillOval ( 93,103+i,14,25 ) ; 
      }  
         g.setColor ( Color.white ) ; 
     for  ( i=5;i < =15;i++  )  
      {  
     g.fillOval ( 93,103+i,14,25 ) ; 
      }  
        }  
     k++; 
      } */
 
     //g.fillOval ( 95,150,8,30 ) ; 
     g.setColor ( Color.black ) ; 
     g.drawOval ( 24,91,16,31 ) ; 
     g.drawOval ( 159,91,16,31 ) ; 
     g.setColor ( Color.green ) ; 
     g.fillOval ( 25,92,15,30 ) ; 
     g.fillOval ( 160,92,15,30 ) ; 
    }  
  }  
 


public static final int BOTTOM
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void clipRect(int x,
                     int y,
                     int width,
                     int height)
See Also:
setClip(int, int, int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void copyArea(int x_src,
                     int y_src,
                     int width,
                     int height,
                     int x_dest,
                     int y_dest,
                     int anchor)
See Also:
IllegalStateException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int DOTTED
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void drawArc(int x,
                    int y,
                    int width,
                    int height,
                    int startAngle,
                    int arcAngle)
See Also:
fillArc(int, int, int, int, int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void drawChar(char character,
                     int x,
                     int y,
                     int anchor)
See Also:
drawChars(char[], int, int, int, int, int), drawString(java.lang.String, int, int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void drawChars(char[] data,
                      int offset,
                      int length,
                      int x,
                      int y,
                      int anchor)
See Also:
drawString(java.lang.String, int, int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void drawImage(Image img,
                      int x,
                      int y,
                      int anchor)
See Also:
copyArea
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void drawLine(int x1,
                     int y1,
                     int x2,
                     int y2)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void drawRect(int x,
                     int y,
                     int width,
                     int height)
See Also:
fillRect(int, int, int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void drawRegion(Image src,
                       int x_src,
                       int y_src,
                       int width,
                       int height,
                       int transform,
                       int x_dest,
                       int y_dest,
                       int anchor)
See Also:
Sprite
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void drawRGB(int[] rgbData,
                    int offset,
                    int scanlength,
                    int x,
                    int y,
                    int width,
                    int height,
                    boolean processAlpha)
See Also:
Image.getRGB(int[], int, int, int, int, int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void drawRoundRect(int x,
                          int y,
                          int width,
                          int height,
                          int arcWidth,
                          int arcHeight)
See Also:
fillRoundRect(int, int, int, int, int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void drawString(String str,
                       int x,
                       int y,
                       int anchor)
See Also:
drawChars(char[], int, int, int, int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void drawSubstring(String str,
                          int offset,
                          int len,
                          int x,
                          int y,
                          int anchor)
See Also:
drawString(String, int, int, int).
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void fillArc(int x,
                    int y,
                    int width,
                    int height,
                    int startAngle,
                    int arcAngle)
See Also:
drawArc(int, int, int, int, int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void fillRect(int x,
                     int y,
                     int width,
                     int height)
See Also:
drawRect(int, int, int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void fillRoundRect(int x,
                          int y,
                          int width,
                          int height,
                          int arcWidth,
                          int arcHeight)
See Also:
drawRoundRect(int, int, int, int, int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void fillTriangle(int x1,
                         int y1,
                         int x2,
                         int y2,
                         int x3,
                         int y3)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getBlueComponent()
See Also:
setColor(int, int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getClipHeight()
See Also:
setClip(int, int, int, int), clipRect(int, int, int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getClipWidth()
See Also:
setClip(int, int, int, int), clipRect(int, int, int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getClipX()
See Also:
setClip(int, int, int, int), clipRect(int, int, int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getClipY()
See Also:
setClip(int, int, int, int), clipRect(int, int, int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getColor()
See Also:
setColor(int, int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getDisplayColor(int color)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Font getFont()
See Also:
setFont(javax.microedition.lcdui.Font)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getGrayScale()
See Also:
setGrayScale(int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getGreenComponent()
See Also:
setColor(int, int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getRedComponent()
See Also:
setColor(int, int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getStrokeStyle()
See Also:
setStrokeStyle(int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getTranslateX()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getTranslateY()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int HCENTER
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int LEFT
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int RIGHT
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setClip(int x,
                    int y,
                    int width,
                    int height)
See Also:
clipRect(int, int, int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setColor(int RGB)
See Also:
getColor()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setColor(int red,
                     int green,
                     int blue)
See Also:
getColor()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setFont(Font font)
See Also:
drawChars(char[], int, int, int, int, int), drawString(java.lang.String, int, int, int), getFont()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setGrayScale(int value)
See Also:
getGrayScale()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setStrokeStyle(int style)
See Also:
getStrokeStyle()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int SOLID
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int TOP
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void translate(int x,
                      int y)
See Also:
getTranslateY(), getTranslateX()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int VCENTER
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  

Popular Tags