dcsimg
Displaying a Text Field in a Canvas.
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ajay_Ajay
Posted On:   Friday, February 21, 2003 03:55 AM

How can I get a 'TextField' to be displayed on a Canvas? public class MyTextField extends Canvas { private TextField tf; public void paint(Graphics g){ tf = new TextField("Text Field","",10,TextField.DECIMAL); g.setColor(255,0,0); g.fillRect(0,0,getWidth(),getHeight()); g.setColor(255,255,255); //** How can I get the display of the Text Field? } } public class Test extends MIDlet { public void startApp() { Canvas canvas = new MyTextField(); display.setCurrent(canvas); } ... ... }    More>>

How can I get a 'TextField' to be displayed on a Canvas?

			
public class MyTextField extends Canvas {
private TextField tf;

public void paint(Graphics g){

tf = new TextField("Text Field","",10,TextField.DECIMAL);

g.setColor(255,0,0);
g.fillRect(0,0,getWidth(),getHeight());
g.setColor(255,255,255);

//** How can I get the display of the Text Field?


}

}

public class Test extends MIDlet {


public void startApp() {

Canvas canvas = new MyTextField();
display.setCurrent(canvas);

}

...

...
}
   <<Less
About | Sitemap | Contact