I am WAY puzzled. I'm using 1.3.1, and I am trying to run someone else's code he wrote in 1.2. When I try to compile, I get a "cannot resolve symbol" for the JMenuItem method getActionListeners(). So I went to the 1.3 API, and sure enough, there is no JMenuItem getActionListeners() method. I mean, there isn't any such method inherited from anywhere, either. It's there in 1.2, and it's there in 1.4, inherited from AbstractButton. Not there in 1.3. What the heck?!? Do I have to install 1.2 or 1.4 to run this program? And what are we supposed to do instead of that method in 1.3? - SA
OOOOOOH! You're SO right. I just went and checked 1.2 again. My bud must have upgraded in the middle of the project w/out telling me, is what he must've done. That scum. Thanks, Dirk. Guess I gotta go install 1.4 before I can get any further. What kind of badness is in store for me there, she wonders? I'll go look for that thread elsewhere. Thanks again. - SA
Sylvia Allen<br />firstname.lastname@example.org
posted 16 years ago
Oh yeah--so in that case, how WERE you supposed to do something like this in 1.3? int i; // Counter JMenuItem origItem; // Item to clone JMenuItem dupItem; // Duplicate for popup ActionListener listeners; // Listeners for origItem popupMenu = new JPopupMenu("Menu for Everything"); origItem = saveMenuItem; dupItem = new JMenuItem(origItem.getText()); listeners = origItem.getActionListeners(); for (i=0; i<listeners.length; ++i) dupItem.addActionListener(listeners[i]); popupMenu.add(dupItem); ... etc.