e839. enable scrolling tabs in a jtabbedpane container.txt
来自「这里面包含了一百多个JAVA源文件」· 文本 代码 · 共 15 行
TXT
15 行
By default, all the tabs in a tabbed pane are displayed. When the tabs are wider than the width of the tabbed pane, they are displayed in rows. If space is an issue, it is possible to configure the tabs to appear in a single row along with a scroller that allows the tabs to be scrolled into view.
// Create a tabbed pane
JTabbedPane pane = new JTabbedPane();
// Add some tabs...; see e830 Adding a Tab to a JTabbedPane Container
// Get the number of rows of tabs
int rows = pane.getTabRunCount();
// Get the current layout policy
int policy = pane.getTabLayoutPolicy(); // WRAP_TAB_LAYOUT
// Configure the tabs to scroll
pane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?