What is Xlets and a simple example program and how to run -


can 1 tell me xlets , simple program (with xlets , java) , softwares required run.

xlets java me platform embedded devices. link may help

netbeans allows run application pc.

a copy , paste link :

package helloxlet; import javax.microedition.xlet.*; import java.awt.borderlayout; import java.awt.component; import java.awt.container; import java.awt.color; import java.awt.dimension; import java.awt.graphics; import java.awt.font;  // create main class. public class main extends component implements xlet {     private container rootcontainer;     private font font;      // initialize xlet.     public void initxlet(xletcontext context) {         log("initxlet called");         // setup default container         // similar standard jdk programming,         // except need container first.         // xletcontext.getcontainer gets parent          // container xlet put awt components in.          // , location arbitrary, needs set.          // calling setvisible(true) make container visible.         try {             rootcontainer = context.getcontainer();             rootcontainer.setsize(400, 300);             rootcontainer.setlayout(new borderlayout());             rootcontainer.setlocation(0, 0);             rootcontainer.add("north", this);             rootcontainer.validate();             font = new font("sansserif", font.bold, 20);         } catch (exception e) {             e.printstacktrace();         }     }      // start xlet.     public void startxlet() {         log("startxlet called");         //make container visible         rootcontainer.setvisible(true);     }      // pause xlet     public void pausexlet() {         log("pausexlet called");         //make container invisible         rootcontainer.setvisible(false);     }      // destroy xlet     public void destroyxlet(boolean unconditional) {         log("destroyxlet called");         //some cleanup xlet..         rootcontainer.remove(this);     }      void log(string s) {         system.out.println("simplexlet: " + s);     }      public void paint(graphics g) {         int w = getsize().width;         int h = getsize().height;         g.setcolor(color.blue);         g.fill3drect(0, 0, w - 1, h - 1, true);         g.setcolor(color.white);         g.setfont(font);         g.drawstring("hello java world", 20, 150);     }      public dimension getminimumsize() {         return new dimension(400, 300);     }      public dimension getpreferredsize() {         return getminimumsize();     } } 

Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -