{
Label l = new Label(0, 30, "Hyperlink to home page");
s1.addCell(l);
URL url = new URL("http://www.andykhan.com/jexcelapi");
WritableHyperlink wh = new WritableHyperlink(0, 30, 8, 31, url);
s1.addHyperlink(wh);
// The below hyperlink clashes with above
WritableHyperlink wh2 = new WritableHyperlink(7, 30, 9, 31, url);
s1.addHyperlink(wh2);
l = new Label(4, 2, "File hyperlink to documentation");
s1.addCell(l);
File file = new File("../jexcelapi/docs/index.html");
wh = new WritableHyperlink(0, 32, 8, 32, file,
"JExcelApi Documentation");
s1.addHyperlink(wh);
// Add a hyperlink to another cell on this sheet
wh = new WritableHyperlink(0, 34, 8, 34,
"Link to another cell",
s1,
0, 180, 1, 181);
s1.addHyperlink(wh);
file = new File("\\\\localhost\\file.txt");
wh = new WritableHyperlink(0, 36, 8, 36, file);
s1.addHyperlink(wh);
// Add a very long hyperlink
url = new URL("http://www.amazon.co.uk/exec/obidos/ASIN/0571058086"+
"/qid=1099836249/sr=1-3/ref=sr_1_11_3/202-6017285-1620664");
wh = new WritableHyperlink(0, 38, 0, 38, url);
s1.addHyperlink(wh);
}
catch (MalformedURLException e)
{
System.err.println(e.toString());