En general, para definir elementos de Java Swing debemos eliminar las J inicial y las vocales, y extraer las tres consonantes más significativas del nombre del control. A continuación figura la lista de componentes y sus prefijos asociados:
1. Nomenclatura de Swing Containers
Contenedor |
Prefijo |
JInternalFrame |
ifrm |
JPanel |
pan |
JScrollPane |
scp |
JTabbedPane |
tpn |
JToolBar |
tlb |
2. Nomenclatura de Swing Controls
Control |
Prefijo |
JButton |
btn |
JButtonGroup |
btg |
JCheckBox |
cbx |
JComboBox |
cmb |
JLabel |
lbl |
JList |
lst |
JPasswordField |
pwd |
JProgressBar |
pgb |
JScrollBar |
scb |
JTable |
tbl |
JTextArea |
txa |
JTextField |
txt |
JTextPane |
txp |
JTree |
jt |
JDateChooser |
jdc |
JCalendar |
jcl |
JRadioButton |
jrb |
3. Nomenclatura de Swing Menus
Menu |
Prefijo |
JMenu |
mnu |
JMenuBar |
mnb |
JMenuItem |
mni |
4. Nomenclatura de Swing Windows
Window |
Prefijo |
JColorChooser |
cch |
JDialog |
dlg |
JFileChooser |
jfc |
JFrame |
frm |
JOprionPane |
opt |
5. Otros
Window |
Prefijo |
DefaultTableModel |
dtm |
JDialog |
dlg |
JFileChooser |
jfc |
JFrame |
frm |
JOprionPane |
opt |