Setting a mnemonic on a tab allows the tab to be selected with a keystroke. For example, if the mnemonic for a tab were the key L, then typing ALT-L (on Windows) would select the tab.

    // Create a tabbed pane
JTabbedPane pane = new JTabbedPane(); // Add a tab
pane.addTab("Tab Label", component); // Get index of the new tab
int index = pane.getTabCount()-1; // Set the mnemonic; on some look and feels, the L in the label will be underlined
int keycode = KeyEvent.VK_L;
pane.setMnemonicAt(index, keycode);
Related Examples

e838. 使JTabbedPane中的卡片能用按键的方式选取的更多相关文章

  1. e839. 使JTabbedPane中的卡片可滚动

    By default, all the tabs in a tabbed pane are displayed. When the tabs are wider than the width of t ...

  2. e835. 使JTabbedPane中的卡片生效和失效

    By default, all new tabs are enabled, which means the user can select them. A tab can be disabled to ...

  3. e840. 监听JTabbedPane中选中卡片的改变

    A tabbed pane fires a change event whenever the selected tab is changed either by the user or progra ...

  4. e832. 从JTabbedPane中移动卡片

    To move a tab, it must first be removed and then reinserted into the tabbed pane as a new tab. Unfor ...

  5. e833. 获得JTabbedPane中的卡片

    This example retrieves all the tabs in a tabbed pane: // To create a tabbed pane, see e828 创建JTabbed ...

  6. 1. 在config.ini文件中加入dm.park.time=1,会使uap中的tomcat启动加快

    在config.ini文件中加入dm.park.time=1,会使uap中的tomcat启动加快

  7. 怎样使GridView中满足某个条件的行可编辑,其余行不可编辑?

    DXperience是个很优秀的第三方控件包,使用起来非常方便,但有时候某些功能的实现在文档中不太容易找到解决方案,比如下面要提到的这个功能我就在文档中找了很久也没找到,最后还是在官方论坛上找到的. ...

  8. 【DEV GridControl】怎样使GridView中满足某个条件的行可编辑,其余行不可编辑?

    DXperience控件包,使用起来非常方便,但有时候某些功能的实现在文档中不太容易找到解决方案,比如下面要提到的这个功能我就在文档中找了很久也没找到,最后还是在官方论坛上找到的. 具体问题是这样的: ...

  9. GridLayout 可使容器中的各个组件呈网格状布局

    GridLayout 可使容器中的各个组件呈网格状布局,平局占据容器的空间,即使容器的大小发生变化,每个组件还是平均占据容器的空间. 和FlowLayout一样,GridLayout也是按照从上到下, ...

随机推荐

  1. [Windows Azure] Load Balancing Virtual Machines

    Load Balancing Virtual Machines All virtual machines that you create in Windows Azure can automatica ...

  2. 每日英语:U.S. Media Firms Stymied in China

    China's recent clampdown on foreign media is crimping the expansion plans of Western news organizati ...

  3. 转webstorm的快捷键

    止 静 java android 转-webstorm快捷键 默认配置-Eclipse的常用快捷键对照表 查找/代替 Webstorm快捷键 Eclipse快捷键 说明 ctrl+shift+N ct ...

  4. c++ primer读书笔记之c++11(三)

    1 =default构造函数限定符 c++11针对构造函数提供了=default限定符,可以用于显式指定编译器自动生成特定的构造函数.析构或赋值运算函数.参考代码如下: class CtorDftTy ...

  5. FireFox在新标签中打开搜索结果

    原文:https://jingyan.baidu.com/article/20b68a88563a1b796cec6228.html 步骤如下: (1)在浏览器的地址栏输入:about:config, ...

  6. Linux: grep多个关键字“与”和“或”

    1.或操作 grep -E '123|abc' filename // 找出文件(filename)中包含123或者包含abc的行 egrep '123|abc' filename // 用egrep ...

  7. 移动web开发(四)——X-UA-Compatible

    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> IE=edge告诉 ...

  8. Android仿华为天气绘制刻度盘

    效果图 能够看到这个自己定义控件结合了颜色渐变.动态绘制刻度.动态水球效果.接下来我们就来看看这个效果是怎样一步一步实现的. 開始自己定义控件 和非常多自己定义控件方式一样须要去基础某种View或者某 ...

  9. [Linux]Shell的运算符和特殊变量

    说起Shell脚本,免不了用变量.特别是对于这种一堆符号表示变量的语言来说,你不了解一下相关变量的本意,根本无从下手.譬如写个循环遍历,$#就起了好大作用.所以还是有必要记录一下,也是对学习的一个笔记 ...

  10. WPF 系列学习

    WPF CheckBox 自定义样式 给Button设置ToolTip 圆角Button 样式