Though the full version of JDK source is available now, but the public src.zip installed under Java\jdk[version_number] directory is still my most frequent refered resource. Every time I encounter an API problem, this public source is read. And besides solving those problems, I’ve also found many interesting things which are sometimes also funny. Here are three exaples.
    Maybe since JDK 5.0, a method called wait(long timeout, int nanos) is introduced into Class java.lang.Object. Wait a minute, nanos, is it nanoseconds? It’s no secret thst even in powerful Windows multimedia API, the precision of timer is only one millisecond, that is a million nanosecond. Though Java is pretty great, it can never deal with nanoseconds. And the source proves it, that nanoseconds are rounded to the nearest millisecond, 0 or 1… Amazing……
    Today I chased a JDialog’s owner, and wanted to find a way to get the owner out, since there’s no method called getOwner(). Finally I was awear that the owner of a JDialog is exactly its parent component. So owner is synonymous with parent now?
    At last, I wanna mention the JSpinner implementation is bugged. Some kinds of listener installed on a JSpinner take no effect at all. I found this comment in JSpinner.java: "Still bogus, nothing else we can do, the SpinnerModel and JFormattedTextField are now out of sync." The JDK developers deserve a thank for honesty. My solution is to directly manipulate the JFormattedTextField within this JSpinner, a compound JComponent.