简体   繁体   English

如何更改netbeans中的标签顺序?

[英]How do I change the tab order in netbeans?

This is how i want my tabs to work:这就是我希望我的标签工作的方式:

Tab1 Tab4表 1 表 4

Tab2 Tab5选项卡 2 选项卡 5

Tab3 Tab6选项卡 3 选项卡 6


But when i use tab netbeans does:但是当我使用 tab netbeans 时:

Tab1 Tab2选项卡 1 选项卡 2

Tab3 Tab4选项卡 3 选项卡 4

Tab5 Tab6选项卡 5 选项卡 6


How can i change the order of my tabs?如何更改标签的顺序?

NetBeans 8.0 I believe the first component (ie. textBox) you add to the design window should be the one the cursor defaults to when you run the program. NetBeans 8.0 我相信您添加到设计窗口的第一个组件(即文本框)应该是运行程序时光标默认使用的组件。 You can set the order for tabbing from component to component when you run the program in the design window.当您在设计窗口中运行程序时,您可以设置从组件到组件的跳格顺序。 Select the first component.选择第一个组件。 In the Properties window, go to nextFocusableComponent and choose the next component you want to tab to in the dropdown list.在“属性”窗口中,转到 nextFocusableComponent 并在下拉列表中选择下一个要使用 Tab 键的组件。 Repeat for rest of components.对其余组件重复此操作。

There is a option for the text field called Next FocusableComponent .文本字段有一个选项,称为Next FocusableComponent You can use that to change the tab-order to anything you like.您可以使用它来将选项卡顺序更改为您喜欢的任何内容。

通过选择 jTabbedPane 下的 jPanel 并上下拖放,我能够更改 [Jframe] - 导航器窗口中选项卡的顺序

右键单击 JTabbedPane-> 更改顺序-> 您将获得上移和下移选项,这将更改选项卡的顺序。

The order of "display" for tabs can be changed in the Navigator section of Netbeans 8.2.可以在 Netbeans 8.2 的导航器部分更改选项卡的“显示”顺序。 Find the one you want to move, right click and then drag it to the position in the list.找到要移动的那个,右键单击,然后将其拖动到列表中的位置。

Using the "Change Order" doesn't change how the tabs are displayed at all.使用“变更单”根本不会改变选项卡的显示方式。 You have to physically move the tab to the place in the list of tabs where you want it to be "displayed".您必须将选项卡物理移动到选项卡列表中要“显示”的位置。 For example, tab number 10 can be moved to the 1st place so that it is always displayed as the the first tab.例如,选项卡编号 10 可以移动到第一个位置,以便它始终显示为第一个选项卡。

Instead of using the "Change Order" use the Navigator panel (if using Netbeans).不要使用“变更单”,而是使用导航器面板(如果使用 Netbeans)。 Make sure you are in the Design screen (not the source screen).确保您在设计屏幕(而不是源屏幕)中。 There you can select the main panel that contains all the tabs and under it will be listed the TABS as panels.在那里,您可以选择包含所有选项卡的主面板,并在其下将 TABS 列为面板。 Then select the one you want to move and move it up or down to where you want it.然后选择您要移动的那个并将其向上或向下移动到您想要的位置。 A good solution is to rename the TABS to an easy to reference naming.一个好的解决方案是将 TABS 重命名为易于引用的命名。 I have 13 TABS (the TABs are named FinancialTAB, SummaryTAB, DiscountTAB, etc.).That way one can see where the TABS are located when using the Navigator section and can select them for moving up or down.我有 13 个 TABS(这些 TAB 被命名为 FinancialTAB、SummaryTAB、DiscountTAB 等)。这样,在使用 Navigator 部分时可以看到 TABS 的位置,并可以选择它们进行向上或向下移动。 Also note that when you select a TAB, the TAB in the "design" GUI screen will highlight -- that lets you know which TAB you have selected.另请注意,当您选择一个 TAB 时,“设计”GUI 屏幕中的 TAB 将突出显示 - 让您知道您选择了哪个 TAB。 Note: I use Netbeans 8.2.注意:我使用 Netbeans 8.2。

选择您的 JFrame 或 JPanel 等,然后选择 JFrame 的 jField 或 jButton 等,然后转到 JField 或 JButton 的属性并启用“focusCycleRoot”(将首先在 jFrame 或 JPanel 中选择此 JField 或 JButton),然后选择导航器窗口中 JFrame 或 JPanel 的“更改顺序”和“上移”或“下移”以更改顺序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM