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.
最简单的方法是将JMenuBar对象设为公共和静态,以允许从程序中的每个其他类进行访问而无需创建额外的实例。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.