Java Reference
In-Depth Information
L ISTING D.11 Continued
}
catch (Exception ex) {
System.out.println(“clipboardExample: “+ex);
}
}
/**
* printing example
*/
private void printExample(){
PrintService prins = (PrintService)GeneralUtilities.getService
(“javax.jnlp.PrintService”);
prins.showPageFormatDialog(new PageFormat());
}
/**
* launch the test
*/
public static void main(String[] args) {
Test test1 = new Test();
}
}
Depending on whether the Test program is launched as a standalone application or via a JNLP
Client, the title property (line 22 of Listing D.12) will be provided by the JNLP file
described as follows, or using the bundled jnlp.properties file. This latter mechanism is pro-
vided by the utility library, as mentioned before. The localization feature (see line 23 of Listing
D.12, for instance) is always provided to applications launched in both modalities.
The JNLP File
Listing D.12 shows the JNLP file used for launching the test class in Listing D.11 previously
presented.
L ISTING D.12 The t est JNLP File.
<?xml version=”1.0” encoding=”utf-8”?>
<jnlp spec=”1.0+”
codebase=”http://server/b2/ad/”
href=”test.jnlp”>
<information>
<title>A Utility Library Test</title>
Search WWH ::




Custom Search