Java Reference
In-Depth Information
private
JPanel
initRecordType
()
{
JPanel
p
=
new
JPanel
();
p
.
setLayout
(
new
GridLayout
(
6
,
2
,
5
,
2
));
p
.
add
(
new
JLabel
(
"Search for:"
));
p
.
add
(
new
JLabel
(
""
));
JRadioButton
any
=
new
JRadioButton
(
"Any"
,
true
);
any
.
setActionCommand
(
"Any"
);
searchFor
.
add
(
any
);
p
.
add
(
any
);
p
.
add
(
this
.
makeRadioButton
(
"Network"
));
p
.
add
(
this
.
makeRadioButton
(
"Person"
));
p
.
add
(
this
.
makeRadioButton
(
"Host"
));
p
.
add
(
this
.
makeRadioButton
(
"Domain"
));
p
.
add
(
this
.
makeRadioButton
(
"Organization"
));
p
.
add
(
this
.
makeRadioButton
(
"Group"
));
p
.
add
(
this
.
makeRadioButton
(
"Gateway"
));
p
.
add
(
this
.
makeRadioButton
(
"ASN"
));
return
p
;
}
private
JRadioButton
makeRadioButton
(
String
label
)
{
JRadioButton
button
=
new
JRadioButton
(
label
,
false
);
button
.
setActionCommand
(
label
);
searchFor
.
add
(
button
);
return
button
;
}
private
JRadioButton
makeSearchInRadioButton
(
String
label
)
{
JRadioButton
button
=
new
JRadioButton
(
label
,
false
);
button
.
setActionCommand
(
label
);
searchIn
.
add
(
button
);
return
button
;
}
private
JPanel
initSearchFields
()
{
JPanel
p
=
new
JPanel
();
p
.
setLayout
(
new
GridLayout
(
6
,
1
,
5
,
2
));
p
.
add
(
new
JLabel
(
"Search In: "
));
JRadioButton
all
=
new
JRadioButton
(
"All"
,
true
);
all
.
setActionCommand
(
"All"
);
searchIn
.
add
(
all
);
p
.
add
(
all
);
p
.
add
(
this
.
makeSearchInRadioButton
(
"Name"
));
p
.
add
(
this
.
makeSearchInRadioButton
(
"Mailbox"
));
p
.
add
(
this
.
makeSearchInRadioButton
(
"Handle"
));