In my code right now a string is added each time the user hits enter. What I want to do is have the text only be added to the line if the line is not empty. IF the line is empty I just want the line to remain blank. To show you what I am looking for I added a gif.
public void keyPressed(KeyEvent e) {
if(e.getKeyCode() == KeyEvent.VK_ENTER){
text11.jt.setText(text11.jt.getText() + " sam");
}
}
Aucun commentaire:
Enregistrer un commentaire