how do i open a frame from my menu bar
i've made a menu bar with netbeans.
in the menubar i've got
file >exit
Help >Help F1
>about
the problem is i don't know how to link up either help or about to another frame that has everything i want the user to see.
can someone pleas开发者_运维知识库e tell me how to go to a new frame once eiher help or about is clicked?
thanks
For About, you would typically use a modal dialog, i.e. a JOptionPane - using those is pretty straightforward. For Help, you don't want a modal dialog, but a new separate JFrame. But you don't have to "go to" it - just create it and call show()
- that's all you need to do. Like modern GUIs in general, Swing does not have an explicit control flow through or between masks. The GUI is shown, and only when the user interacts with it is your code in the various event handlers called.
精彩评论