Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

some help with gui things

 
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: 3281
84
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: 52630
119
  • 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: 52630
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Individual listeners. Haven't got the time to elaborate now, I am afraid.
 
Paper has not yet been outlawed – so let your Java Swing application print with wild abandon: JPDF
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!