Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

some help with gui things  RSS feed

 
Timothy Hoogen
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right now, I'm busy with the GUI of some kind of simulation program for the traveling salesmen problem
When I run my program, you get first a jframe with some Radio Buttons (Settings) where you can choose what code you want to run. After that the Settings jframe dissappear, and the frame where you can run the simulation appears.
Now if I open the Settings jframe again and I choose another Radio Button, nothing changes anymore.
How can I solve this?


Here is some code I use:

GUI:



SettingsDialog:

 
Knute Snortum
Sheriff
Posts: 4073
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I moved this to the "GUI" forum, it may get more traction there.
 
Campbell Ritchie
Marshal
Posts: 55694
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you using actions on a dialogue?
Why are you using addActionListener(this)? It is usually poor coding design, and probably even worse on a dialogue window.
 
Timothy Hoogen
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe because I'm a beginner who just started coding.

What should i use instead of addActionListener(this)?
 
Campbell Ritchie
Marshal
Posts: 55694
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Individual listeners. Haven't got the time to elaborate now, I am afraid.
 
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!