This example demonstrates various ways to add a tab to a tabbed pane.

    // Create a tabbed pane
JTabbedPane pane = new JTabbedPane(); // Add a tab with a label taken from the name of the component
component1.setName("Tab Label");
pane.add(component1); // Add a tab with a label at the end of all tabs
String label = "Tab Label";
pane.addTab(label, component2); // Add a tab with a label and icon at the end of all tabs
Icon icon = new ImageIcon("icon.gif");
pane.addTab(label, icon, component3); // Add a tab with a label, icon, and tool tip at the end of all tabs
String tooltip = "Tool Tip Text";
pane.addTab(label, icon, component4, tooltip); // Insert a tab after the first tab
int index = 1;
pane.insertTab(label, icon, component5, tooltip, index);
Related Examples

e830. 向JTabbedPane中加入一个卡片的更多相关文章

  1. e831. 从JTabbedPane中删除一个卡片

    // To create a tabbed pane, see e828 创建JTabbedPane // Remove the last tab pane.remove(pane.getTabCou ...

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

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

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

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

  4. Ionic 2 中创建一个照片倾斜浏览组件

    内容简介 今天介绍一个新的UI元素,就是当我们改变设备的方向时,我们可以看到照片的不同部分,有一种身临其境的感觉,类似于360全景视图在移动设备上的应用. 倾斜照片浏览 Ionic 2 实例开发 新增 ...

  5. 在iOS中实现一个简单的画板App

    在这个随笔中,我们要为iPhone实现一个简单的画板App. 首先需要指出的是,这个demo中使用QuarzCore进行绘画,而不是OpenGL.这两个都可以实现类似的功能,区别是OpenGL更快,但 ...

  6. 如何在ASP.NET Core中实现一个基础的身份认证

    注:本文提到的代码示例下载地址> How to achieve a basic authorization in ASP.NET Core 如何在ASP.NET Core中实现一个基础的身份认证 ...

  7. 在ASP.NET Core中实现一个Token base的身份认证

    注:本文提到的代码示例下载地址> How to achieve a bearer token authentication and authorization in ASP.NET Core 在 ...

  8. Step by step 活动目录中添加一个子域

    原创地址:http://www.cnblogs.com/jfzhu/p/4006545.html 转载请注明出处 前面介绍过如何创建一个域,下面再介绍一下如何在该父域中添加一个子域. 活动目录中的森林 ...

  9. [转]如何在ASP.NET Core中实现一个基础的身份认证

    本文转自:http://www.cnblogs.com/onecodeonescript/p/6015512.html 注:本文提到的代码示例下载地址> How to achieve a bas ...

随机推荐

  1. Java 虚拟机:互斥同步、锁优化及synchronized和volatile

    互斥同步 互斥同步(Mutual Exclusion & Synchronization)是常见的一种并发正确性保证手段.同步是指子啊多个线程并发访问共享数据时,保证共享数据在同一时刻只能被一 ...

  2. [Windows Azure] How to Scale an Application

    How to Scale an Application To use this feature and other new Windows Azure capabilities, sign up fo ...

  3. 每日英语:How Often Do Gamblers Really Win?

    The casino billboards lining America's roadways tantalize with the lure of riches. 'Easy Street. It' ...

  4. 根据ip查询经纬度的接口

    http://ip-api.com/json/ 直接访问,结果如下 // 20180804140751 // http://ip-api.com/json/ { "as": &qu ...

  5. vue如何在路由跳转的时候更新组件

    项目中在路由跳转的时候碰到一个问题,没有更新视图,如何解决呢: https://segmentfault.com/a/1190000008879966 http://www.tuicool.com/a ...

  6. 内核参数SEMMSL SEMMNS SEMOPM SEMMNI参数的设置

    内核参数SEMMSL SEMMNS SEMOPM SEMMNI参数的设置  转自:http://www.dbafree.net/?p=92   这四个参数自己一直没搞清楚 今天问了下同事,大概整了一下 ...

  7. easyui扩展

    datagrid行内编辑时为datetimebox $.extend($.fn.datagrid.defaults.editors, { datetimebox: {// datetimebox就是你 ...

  8. 将目录下面所有的 .cs 文件合并到一个 code.cs 文件中,写著作权复制代码时的必备良药

    将目录下面所有的 .cs 文件合并到一个 code.cs 文件中,写著作权复制代码时的必备良药 @echo off echo 将该目录下所有.cs文件的内容合并到一个 code.cs 文件中! pau ...

  9. win8中完成进度

    public sealed partial class WorkItem : Page { private IAsyncAction _threadPoolWorkItem; private Manu ...

  10. 轻松学习JavaScript二十七:DOM编程学习之事件模型

    在介绍事件模型之前,我们先来看什么是事件和什么是event对象. 一事件介绍 JavaScript事件是由訪问Web页面的用户引起的一系列操作,使我们有能力创建动态页面.事件是能够被 JavaScri ...