Create a menu item.
229 JMenuItem retval =
new JMenuItem(text +
" ");
230 retval.setMnemonic(mnemonic);
232 Registry conf = Registry.getCurrent();
233 retval.setFont((Font) conf.get(
"component",
"font"));
234 retval.setForeground((Color) conf.get(
"component",
"fgcolor"));
236 Integer delay = (Integer) conf.get(
"component",
"click-delay");
238 retval.setMultiClickThreshhold(delay);
242 if (accel < VK_F1 || accel > VK_F12)
243 modifiers |= InputEvent.CTRL_DOWN_MASK;
245 KeyStroke ks = KeyStroke.getKeyStroke(accel, modifiers);
246 retval.setAccelerator(ks);
250 text = text.replace(
'.',
' ').trim();
251 retval.setActionCommand(text);
252 retval.addActionListener(
handler);
254 String nm = text.toLowerCase().replace(
' ',
'_') +
"16.png";
255 retval.setIcon(conf.loadIcon(nm));