CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2005
    Posts
    3

    HOw to Execute JAVA Code using JFram

    Hi guys,
    I am doing a program using JFrame. In this program, I use the aboutMenu. In this About Menu, I want to have an option "Creator"where I can execute another file called "TheCreators". "TheCreator.java" contained a GUI i made to display all members of our group with some animation.
    Please show me how to run TheCreator.java using ActionListerner in JFrame!!!!

    Thanx a lot

  2. #2
    Join Date
    Sep 2004
    Posts
    247

    Re: HOw to Execute JAVA Code using JFram

    I think you want to do something along the lines:

    Code:
    public class MyClass extends JFrame implements ActionListener {
    
    
      setupMenu() {
        JMenuBar menuBar = new JMenuBar();
    
        JMenu aboutMenu = new JMenu("About");
        fileMenu.setMnemonic('A');
        JMenuItem creatorMenuItem = new JMenuItem("Show Creator");
        creatorMenuItem.setMnemonic('C');
        creatorMenuItem.addActionListener(this);
        aboutMenu.add(creatorMenuItem );
    
        setJMenuBar(menuBar);
      }
    
      public void actionPerformed(ActionEvent e) {
        if (e.getActionCommand().equals("Show Creator")) {
          doShowCreator();
        }
      }
    
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured