This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

access GUI member directly?

 
peter hammond
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys

i have a GUI that has the usual suspects in it a ComboBox and Treeview and Listview.. (javaFX)

my question is should these members be public or should i keep them private and use a public method to return and add values to these members?? from other classes and Threads and methods....

hope that makes sense

many thanks for your advice...

arrh wrong section sorry bout that....
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Having the variable private is general part of OOPS programming and I don't think there is anything different here.

If you want other classes to be notified when the selection is changed, the correct solution would be to attach them as listeners (say to the valueProperty of the combo box).
 
peter hammond
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the reply...

i wasn't sure how best to access these members i will leave them as they are then good idea on the listener i will add one of them in....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic