This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JavaFX and the fly likes access GUI member directly? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » JavaFX
Bookmark "access GUI member directly?" Watch "access GUI member directly?" New topic
Author

access GUI member directly?

peter hammond
Ranch Hand

Joined: Apr 20, 2011
Posts: 41
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

Joined: Oct 16, 2003
Posts: 1077
    
  10

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).


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
peter hammond
Ranch Hand

Joined: Apr 20, 2011
Posts: 41
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....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: access GUI member directly?