Guest User

CustomItem J2ME

a guest
Mar 2nd, 2016
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.84 KB | None | 0 0
  1. package custom;
  2.  
  3. import javax.microedition.lcdui.CustomItem;
  4. import javax.microedition.lcdui.Graphics;
  5. import javax.microedition.lcdui.Screen;
  6. import javax.microedition.lcdui.TextField;
  7.  
  8. /**
  9.  *
  10.  * @author Giliwawaa
  11.  */
  12. public class AlaaTextField extends CustomItem{
  13.  
  14.     public AlaaTextField(String label) {
  15.         super(label);
  16.         this.setPreferredSize(240, 20);  
  17.     }
  18.    
  19.  
  20.     protected int getMinContentHeight() {
  21.         return 20;
  22.     }
  23.  
  24.     protected int getMinContentWidth() {
  25.         return 240;
  26.     }
  27.  
  28.     protected int getPrefContentHeight(int width) {
  29.         return 20;
  30.     }
  31.  
  32.     protected int getPrefContentWidth(int height) {
  33.         return 240;
  34.     }
  35.  
  36.     protected void paint(Graphics g, int w, int h) {  
  37.         g.setColor(255, 255, 255);
  38.         g.fillRect(0, 0, w, h);  
  39.     }
  40.    
  41. }
Advertisement
Add Comment
Please, Sign In to add comment