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线程池任务数大小设置

    线程池究竟设成多大是要看你给线程池处理什么样的任务,任务类型不同,线程池大小的设置方式也是不同的. 任务一般可分为:CPU密集型.IO密集型.混合型,对于不同类型的任务需要分配不同大小的线程池. CP ...

  2. angular学习笔记(三十一)-$location(2)

    之前已经介绍了$location服务的基本用法:angular学习笔记(三十一)-$location(1). 这篇是上一篇的进阶,介绍$location的配置,兼容各版本浏览器,等. *注意,这里介绍 ...

  3. python(35):多线程读取文件

    多线程读取文件: # _*_coding:utf-8_*_ import time, threading, ConfigParser ''' Reader类,继承threading.Thread @_ ...

  4. vue监听浏览器窗口的变化,随着窗口变化调整里面table的宽高

    1.在data中设置: tableHeight:"500", screenHeight:window.innerHeight, 2.在mounted中设置: mounted() { ...

  5. Windows系统盘瘦身指南

    [本文出自天外归云的博客园] Windows系统的C盘空间越来越小,按以下四步进行清理,还你6个G: 1.开启腾讯管家之类的软件进行第一轮垃圾清理: 2.删除以下文件夹,"C:\Progra ...

  6. WideCharToMultiByte和MultiByteToWideChar函数的用法(转)

    转自:http://www.cnblogs.com/gakusei/articles/1585211.html 为了支持Unicode编码,需要多字节与宽字节之间的相互转换.这两个系统函数在使用时需要 ...

  7. 开源一个爬取redmine数据的测试报告系统

    背景 软件测试的最后有一道比较繁琐的工作,就是编写测试报告.手写测试报告在数据统计和分析上面要耗费比较大的事件和精力.之前工作室使用mantis管理bug缺陷.公司有内部有个系统,可以直接从manti ...

  8. 【WPF】添加自定义字体

    需求:在WPF项目中使用幼圆字体. 步骤: 1.首先要有幼圆TTF字体文件.在C:\Windows\Fonts目录下找,如果系统字体库中没有,就上网下一份,如这里或这里. 2.将字体文件复制到WPF项 ...

  9. Java log4j slf4j 日志配置笔记

    http://www.cnblogs.com/Scott007/p/3269018.html 日志的打印,在程序中是必不可少的,如果需要将不同的日志打印到不同的地方,则需要定义不同的Appender, ...

  10. Android——ViewPager滑动背景渐变(自定义view,ViewPager)

    效果: ActivityBackgroundImage,java(自定义视图) package com.example.chenshuai.test322; import android.conten ...