Naming Conventions for GUI elements
Component Type |
Naming Prefix |
Example |
JButton |
btn |
btnClickMe |
JCheckBox |
chk |
chkTaxable |
JRadioButton |
rad |
radChoice |
ButtonGroup |
grp |
grpCoffeeType |
JToggleButton |
tgl |
tglSelected |
JComboBox |
cbo |
cboDropDown |
JLabel |
lbl |
lblLastName |
JTextField |
txt |
txtEntryField |
JTextArea |
txt |
txtEntryArea |
JTextPane |
txt |
txtEntryBox |
JList |
lst |
lstChoiceList |
JScrollPane |
scr |
scrHorizontalScrollPane |
JMenu |
mnu |
mnuFileMenu |
JSeparator |
sep |
sepSeparator1 |
If you don’t see a prefix
for the GUI widget you want to use, please suggest one to me by email
[azs@bu.edu] and I’ll add it to the list.