开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜