netbeans 中JTabbedPanel的使用
netbeans 中JTabbedPanel的使用
http://java.sun.com/developer/onlineTraining/tools/netbeans_part1/#importing
So far, you have created a project and a JFrame
class called SamplesJFrame
. Next, you'll build on theJFrame
component and add other components.
- Click on Tabbed Pane in the Palette, then click on the blank square in the design form. This creates a
JTabbedPane
. Notice that all the components you've created are listed in the Inspector window. - Click on Panel in the Palette, then click inside the
JTabbedPane
in the editor (you may need to resize theJTabbedPane
so it is larger. AJPanel
is created. Note that a new tabbed pane has been added toJTabbedPane
. - Add another
JPanel
to theJTabbedPane
in the Design Editor. Another tab appears. You can add as many tabs as you like, but this tutorial covers only two.
上面的意思就是首先在JFrame中添加一个JTabbedPane
,然后在点击右键,添加Panel即可。而不是继续添加JTabbedPane
。
最后使用"编辑文本"来编辑每个tab中上面显示的名称。
如果您觉得不错,欢迎扫码支持下。
作者:许强1. 本博客中的文章均是个人在学习和项目开发中总结。其中难免存在不足之处 ,欢迎留言指正。 2. 本文版权归作者和博客园共有,转载时,请保留本文链接。