java - Get input from button -
i have program receives input command line before. want make gui using java swing. supposed have program flow such below:
while(!end){ in = getinputfromuser(); /*value can 1,2, or 3*/ execute(in); /* else */ end = isendcondition(); }
how can input using 3 buttons instead?
depending on how gui should work, typically use actionlistener definied on button. here complete example (including text field) oracle documentation: https://docs.oracle.com/javase/tutorial/uiswing/events/actionlistener.html
Comments
Post a Comment