slick2d - JTextField area for Slick Java -


what want want jtextfield in slick application. know how make 1 java, not slick. slick have one?

i want textfield can type in (like in login form, or something).

i used code:

import org.newdawn.slick.*; import org.newdawn.slick.gui.textfield; import org.newdawn.slick.state.*;  public class exmaple extends basicgamestate {  textfield commandbox;  public example(int state) {  }  public void init(gamecontainer gc, statebasedgame sbg) throws slickexception {      commandbox = new textfield(gc, null, 20, 20, 80, 5);  }  public void render(gamecontainer gc, statebasedgame sbg, graphics g) throws slickexception {      commandbox.render(gc, g);  }  public void update(gamecontainer gc, statebasedgame sbg, int delta) throws slickexception {  //no code here  }  public int getid() {     return 1;     }  } 

commandbox item want textfield. code above doesn't work. there better/similar code can use make textfield game?


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -