25 March 2005 - java_dev (original) (raw)

Java developers

March 25th, 2005

08:45 am - finickynarcane - Next little stumbling block... Thank you all for the help the last time I needed it.Today's issue is the newline ("\n")I have an array full of strings. Every once in a while one of the elements gets a "\n" in the middle of the string it contains that I don't want. I do want the sub strings on either side of the newline. What is the easy/simple/direct way to remove that newline and replace it with a space?I triedpickData[1].replace('\n', ' ');and saw no change in the behavior.Thank you.
12:09 pm - steprous - JavaOne anyone ever been to the JavaOne Conference?Whats it likewhat did you learnetc.any stories, tips or warnings.thanks
12:26 pm - christtrekker - synchronizing Calendars As a side interest to my hobby of astronomy, I'm interested in calendaring systems and timekeeping. I'm trying to use the com.ibm.icu.util.*Calendar classes to create a little app that will display the dates in various systems whenever I change any one of them. I thought it would be a fun exercise, and useful to learn a bit more about Java.The problem is how to keep them in sync. There is no "CalendarChangeEvent" and even if there were the calendars provide no facility for listening for it either. I have started to try to write my own, but all the instruction I've ever had on events is how to listen for and handle ones that the OS creates for you. How do I write my own event? How should I signal my listeners that the event happened? I can't find any tutorials on this sort of thing, and my attempts feel clumsy to me. I think my situation is a little unique in that not only do the objects need to know about all the listeners it has, but the listener also needs to know about all the objects (so it can pass the signal to sync on to them). Or if there's an easier route I should be taking, please let me know.This appears to be a situation where multiple inheritance would really really be helpful, since all the classes I derive from any *Calendar also will need to implement the exact same code for the events. I'm using an interface, but I'm still implementing the code multiple times. The best I can do is put docs in the interface reminding myself "now when you implement this, it has to do X and Y".