• Post Reply Bookmark Topic Watch Topic
  • New Topic

Use JButton to pass value to nextInt()  RSS feed

 
ilumi kinoko
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Because I want to write a JFrame program.
In some reason I want to stop certain line by using nextInt().
Then I can exit by enter 0 (I set the condition)
Now the problem is I want to totally use GUI , and want to use GUI to stop the whole program.

Is there any way I can pass value to nextInt()
instead of switch to cmd to enter 0 to stop.

Thank you
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16057
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Can you show us some of your code, and explain more clearly what you want to know exactly?
 
ilumi kinoko
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jesper,

here is my code
I will explain what I wanna do in //comment





Thank you
 
ilumi kinoko
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No need to reply, nice persons (no offended , please do not misunderstand)
I have already solved this problem by using thread

Thanks to Steve, who just show an URL and then let me learn and know how thread works.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!