|
-
May 18th, 2005, 02:32 PM
#1
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
-
May 18th, 2005, 03:02 PM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|