Most read:
Popular archives:
JavaWorld's new look is here!
We've upgraded the site with a fresh look-and-feel, improved topical navigation, better search, new features, and expanded
community platform. Learn more about the changes to JavaWorld.
| Oracle Compatibility Developer's Guide |
| The Explosion in DBMS Choice |
Here's a quick recap of the situation: Due to mounting concerns over Sun's licensing terms, the folks doing the non-commercial ports of Java "fringe" platforms like Linux pulled the plug on the port of the Sun JDK v. 1.0.2.
Since last month, the Sun folks have described this occurrence as a case of confusion between the non-commercial and commercial licenses. The Sun folks then explained their position, saying:
"...the bottom line is that JavaSoft welcomes and encourages the distribution of non-commercial ports, and we are sorry that any confusion existed on this issue. It seems our fault existed in not responding quickly enough to your diligent inquiries for further information."
The above statement does not put the matter to rest entirely; the porters are waiting for Sun's response on a few issues. As of this writing, Sun still has not given explanations. Because it appears that these relatively minor issues will be resolved reasonably, work on the port itself has been resumed. The port will not be released until the issues are finally resolved.
The bottom line is that it looks like Sun is relatively serious about seeing that the "openness" of Java is preserved. Yea!!!
Question: The following code works under the Appletviewer but draws nothing under Netscape. What's up?
import java.applet.Applet;
import java.awt.List;
public class simple extends Applet
{
public void init()
{
List foo = new List (4,true);
this.add(foo);
}
}
Well, I would say that it is a question of interpretation of what the abstract windowing toolkit (AWT) is supposed to do in this situation (where the created list is empty).
The applet is there and is running. Under Netscape 3.0, if the list does not have any entries then it will not build-out/draw the list.
One trick could have been to put something like " " as the only item in the list and then delete it after the list has been built. Unfortunately, in this case and any of the simple variations thereof, it will only build out a list that has one visible element.
Also note that it only builds out MIN(visible list elements value [e.g., 4], the number of actually added items) so in this case you will have to do foo.addItem (" ") four times! But note that the list will not have a scrollbar; if you want to have it build out with a scrollbar initially, you should use n+1 (e.g., 5) instead.
At this point, if you really want to have an empty list, you will have to do something more complex.
Jim Field asks: How do you get a Java application to send data out the serial port (COM1 or 2) of the PC?
Since this sort of low-level system access is not portable, there is no portable Java way to do it. You will need to resort to writing Java native methods -- that is, C code which does the actual work. You write Java "wrappers" for the C code to make it available to your Java code.