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. 深入云存储系统Swift核心组件:Ring实现原理剖析

    http://www.cnblogs.com/yuxc/archive/2012/06/22/2558312.html 简介 OpenStack是一个美国国家航空航天局和Rackspace合作研发的开 ...

  2. Replace 在动态sql中的实现

    set @stsqlReplace=' update ChgCfm set cfmdate=replace(cfmdate,'''''''',''''), cfmstatu=replace(cfmst ...

  3. C#对Sql Server TEXT字段存储的实现(使用存储过程)

    1.这里先准备数据库:在数据库中建立一个News数据表,字段为id,title,content2.建立用于插入news的存储过程:NewsInsert和NewsUpdate,代码如下: ),@cont ...

  4. [SQL in Azure] Provisioning a SQL Server Virtual Machine on Azure

    http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-provision-sql-server/ Provi ...

  5. linux命令(44):sed,vim;去掉文件中的^M 符号,去掉行首空格和制表符

    注:下面的直接粘贴会出错,要重新输入^M 如何输入^M,先 ctrl+v,然后 ctrl+m 第一种方法: cat -A filename 就可以看到windows下的断元字符 ^M要去除他,最简单用 ...

  6. 【Qt】qt库结构及示例

    QT库结构 Qt图形库是一个组织严谨的C++类库,其结构如图所示 细说Qt库 Qt类库中包含了上百个类,结构十分复杂,上图展示了Qt_3.2类库的基本结构. Qt类库中的类可以分成两种类型: 一种是直 ...

  7. Vue之vuex实现简易计算器

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  8. js获取系统的根路径实现介绍

    js如何获取系统的根路径,在本文给出了详细的方法 function getBasePath(){ var obj=window.location; var contextPath=obj.pathna ...

  9. Cpu表现出正弦曲线

    #include <windows.h> #include <math.h> int main(void) { SetThreadAffinityMask(GetCurrent ...

  10. Linux watchdog 关闭退出功能

    Linux 程序退出的时候,程序是会把 watchdog 调用 release 功能.