-1

I have created a JMenuBar and I want to use that JMenuBar in every form of my swing application. Writing JMenuBar in every form is not an efficient programming. So, I want to use the same JMenuBar in every form. But I have no clue how to do it. Can anyone show me some sample, so I can use it in my project.

Patrick
  • 4,532
  • 2
  • 26
  • 32
Indranil Banerjee
  • 133
  • 1
  • 1
  • 11
  • `Can anyone show me some sample, so I can use it in my project. ` yes we can help you, but **1)** we have no idea how your project looks like. **2)** Can you show us what have you tried and where you're stuck? Please consider reading [How to ask](http://stackoverflow.com/questions/ask) section and [How to create a Minimal, Complete and Verifiable Example](http://stackoverflow.com/help/mcve). – Frakcool Aug 13 '14 at 19:05

1 Answers1

2

The easiest way to do this would be making the JMenuBar Object public and static to allow access from every other class in the program without creating extra instances.

zfollette
  • 475
  • 4
  • 15