I am pretty new to Java, so there is probably a simple answer to this one...
The thing is that I have made a class that extends the JPanel class, and I wanted to make it as broad as abstract as possible...
class JComponentPanel extends JPanel
public JComponentPanel(JComponent coms, EventListener listener, int alignment, int mnemonic, int fill1, int fill2)
setLayout(new FlowLayout(alignment, fill1, fill2));
for(int i = 0; i < coms.length; i++)
My first problem was to figure out which type of JComponent I had to process, and I fixed this using the getClass method, which seems kindof a hack. Is there another way to do this!?
Then my other problem is the assignement of Listeners. Since I am passing an EventListener array to the constructor, I have to typecast the listeners before adding them. This is actually working for the ActionListener, but not for the ItemListener...!? Why!?
The setMnemonic does not work for the JCheckBox either!
Hope you can help!? Thanks!