November 2000
Intermediate to advanced
1152 pages
23h 32m
English
Converting the code we've written to display a document in a window isn't difficult because that code was purposely written to store the output in an array of strings; I can display those strings in a Java window. In this example, I'll upgrade that code to a new program, browser.java, which will use XML for Java to display XML documents in a window.
Here's how it works; I start by parsing the document that the user wants to parse in the main method:
public static void main(String args[]) {
displayDocument(args[0]);
.
.
.Then I'll create a new window using the techniques we've seen in the previous chapter. Specifically, I'll create a new class named AppFrame, create an object of that class, and display it:
public ...
Read now
Unlock full access