• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to invoke another internalframe to another internalframe

 
naive programmer
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What should be included in the actionPerformed method to invoke another internal frame that is not in the same class file and not in the main class file.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"naive programmer" -

Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy.
You can change it here.

When you say "invoke another internal frame" what do you mean? Call some method on the other internal frame? Create another frame? Since you mention actionPerformed(), why not make the frame you want to "react" an ActionListener, and have it's actionPerformed() method call the method you want to call on this frame. In the "originator" frame, you could make an addActionListener() method that adds the specified ActionListener to whatever componenent is calling the actionPerformed() method in your question. Then whenever that component throws an action event, all ActionListeners attached in this way are notified...

Pseudo-code:


Thanks! and welcome to the JavaRanch!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!