netbeans 中JTabbedPanel的使用

来源:互联网 发布:windows server一键nas 编辑:程序博客网 时间:2024/05/17 21:38

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.

  1. 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.
  2. Click on Panel in the Palette, then click inside the JTabbedPane in the editor (you may need to resize theJTabbedPane so it is larger. A JPanel is created. Note that a new tabbed pane has been added toJTabbedPane.
  3. Add another JPanel to the JTabbedPane 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中上面显示的名称。

 

 

 

原创粉丝点击