Java Reference
In-Depth Information
this
this
(
null
null
,
"Compose"
,
null
null
,
300
,
200
);
}
/** Constructor for MailComposeBean object.
*
* @param parent Container parent. If JFrame or JInternalFrame,
* will setvisible(false) and dispose() when
* message has been sent. Not done if "null" or JPanel.
* @param title Title to display in the titlebar
* @param recipient Email address of recipient
* @param height Height of mail compose window
* @param width Width of mail compose window
*/
MailComposeBean
(
Container parent
,
String title
,
String recipient
,
int
int
width
,
int
int
height
) {
super
super
();
this
this
.
parent
=
parent
;
mywidth
=
width
;
myheight
=
height
;
// THE GUI
Container cp
=
this
this
;
cp
.
setLayout
(
new
new
BorderLayout
());
// Top is a JPanel for name, address, etc.
// Center is the TextArea.
// Bottom is a panel with Send and Cancel buttons.
JPanel tp
=
new
new
JPanel
();
tp
.
setLayout
(
new
new
GridLayout
(
3
,
2
));
cp
.
add
(
BorderLayout
.
NORTH
,
tp
);
tfs
=
new
new
JTextField
[
MAXTF
];
tp
.
add
(
new
new
JLabel
(
"To: "
,
JLabel
.
RIGHT
));
tp
.
add
(
tfs
[
TO
] =
toTF
=
new
new
JTextField
(
35
));
iif
(
recipient
!=
null
null
)
toTF
.
setText
(
recipient
);
toTF
.
requestFocus
();
tp
.
add
(
new
new
JLabel
(
"Subject: "
,
JLabel
.
RIGHT
));
tp
.
add
(
tfs
[
SUBJ
] =
subjectTF
=
new
new
JTextField
(
35
));
subjectTF
.
requestFocus
();