Michail Petrov wrote:coud you give me simple code i can geht it i use the setJMenuBar but the result is the same
Well, I will give you some stock sample code so you can apply it to your application. Let's say I have a Name object that makes a firstName and a lastName. I then have a Person class that wants to print the firstName. The first thing to do would be to make the Name object. If Name looked the way firmFrame does in your application, then it might look like this:
And Person might try to do this:
If the goal is for Person to print Name's first name, well it won't work. I have to change Name so that the firstName becomes visible to Person. First I have to make a member variable in Name to store the firstName, then I have to make a method which returns that value.
Now Person can call Name's getFirstName() method in order to print it out:
Just to round things off, I will modify Name one more time, so that lastName gets the same treatment as firstName, just in case I want to print out lastName at some point as well:
Hopefully you will be able to see what you need to do and apply it to your application.