If you wanted the credit() method to send text to display on the Screen object, then just use that one line ((Screen) getWorld()... in the credit() method, nothing more.
oh, sorry I didn't get your point.
ok, then I just put this code in any class I want to update the Screen display.
just a question, I put this code in the world as I mentioned before. I think it doesn't matter to leave it there, does it?
I think you misunderstand. You insert it into your code whenever you need to change the text of the Screen. It is not that just goes into a class. For example, if at some point the program catches that the user tried to dispense something without sufficient credit, you may want it to say something like "Make another selection". Wherever in your code you catch this situation, you add the line to change the text of the Screen.
Actually, it would be better to say, just substitute the String in the calls to setText("string").
BTW, you still have not seen my response in Private Messaging.