JFrame

+1 Calvin McPeak · December 2, 2014
Hey i currently have a jframe with a jpanel, and a jMenuBar inside with 3 JMenuItems.

In another class have have made the relevant forms for each of the 3 MenuItems, 

How can i link these forms so that when a JMenuItem is click on the relevant form will appear, I've tired using the action listener but it doesn't seem to be working properly, any help would be greatly appreciated.

Post a Reply

Replies

Oldest  Newest  Rating
0 Carlos Parra · December 2, 2014
Hello Calvin,

you could do this:
e.g.

private void jMenuItem2ActionPerformed(ActionEvent evt) {
        new Form2().setVisible(true); //this is what u have to make

}

where Form2 - is the name of the class with the corresponding form.


hope that help you. If you have another question, just let me know ;)
  • 1

Java / Android Development

106,965 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator