Java Reference
In-Depth Information
"TARGET parameter REQUIRED"
);
iif
((
targetHost
=
getParameter
(
TARGET2
)) ==
null
null
)
throw
throw new
new
IllegalArgumentException
(
"TARGET parameter REQUIRED"
);
String theURL
=
"mailto:"
+
targetName
+
"@"
+
targetHost
;
subject
=
getParameter
(
"subject"
);
iif
(
subject
!=
null
null
)
theURL
+=
"?subject="
+
subject
;
targetURL
=
new
new
URL
(
theURL
);
}
catch
catch
(
MalformedURLException rsi
) {
throw
throw new
new
IllegalArgumentException
(
"MalformedURLException "
+
rsi
.
getMessage
());
}
label
=
getParameter
(
"label"
);
// i.e., "Send feedback"
iif
(
label
==
null
null
)
throw
throw new
new
IllegalArgumentException
(
"LABEL is REQUIRED"
);
// Now handle font stuff.
fontName
=
getParameter
(
"font"
);
iif
(
fontName
==
null
null
)
fontName
=
DEFAULTFONTNAME
;
String s
;
iif
((
s
=
getParameter
(
"fontsize"
)) !=
null
null
)
fontSize
=
Integer
.
parseInt
(
s
);
iif
(
fontName
!=
null
null
||
fontSize
!=
0
) {
// System.out.println("Name " + fontName + ", size " + fontSize);
theFont
=
new
new
Font
(
fontName
,
Font
.
BOLD
,
fontSize
);
}
Button b
=
new
new
Button
(
label
);
b
.
addActionListener
(
new
new
ActionListener
() {
public
public
void
void
actionPerformed
(
ActionEvent e
) {
iif
(
targetURL
!=
null
null
) {
// showStatus("Going to " + target);
getAppletContext
().
showDocument
(
targetURL
);
}
}
});
iif
(
theFont
!=
null
null
)
b
.
setFont
(
theFont
);