I asked this question a few hours ago, but I think I didn't explain myself well. Here is my code:
for (a = 1; a < 14; a++) {
JMenuItem "jmenu"+a = new JMenuItem(String.valueOf(a));
"jmenu"+a.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
rrr[a] = a;
texto.setFont(texto.getFont().deriveFont((float) a));
current = a;
}
});
tamano.add("jmenu"+a);
}
What I need to do is create several JMenuItem
s with these names:
jmenu1
jmenu2
jmenu3
jmenu4
etc...
---EDIT----
What I want is that each JMenuitem
has a different name:
JMenuItem "jmenu"+a //with this I can't create the JMenuItem; it's not permitted
= new JMenuItem(); //I dont care about this