// Create a tabbed pane
JTabbedPane pane = new JTabbedPane(); // Set the text color for all tabs
pane.setForeground(Color.YELLOW); // Set the background color for all tabs
pane.setBackground(Color.MAGENTA); // Add a tab
String label = "Tab Label";
pane.addTab(label, component); // Get index of the new tab
int index = pane.getTabCount()-1; // Set text color for the new tab
pane.setForegroundAt(index, Color.ORANGE); // Set background color for the new tab
pane.setBackgroundAt(index, Color.GREEN);
Related Examples

e837. 设置JTabbedPane中卡片的颜色的更多相关文章

  1. e836. 设置JTabbedPane中卡片的提示语

    There are two ways to set a tool tip on a tab. The first is to specify it when the tab is created; t ...

  2. e834. 设置JTabbedPane中卡片的位置

    The tabs of a tabbed pane can be placed on one of the four edges of its container. By default, when ...

  3. QT5如何设置QLabel中字体的颜色

    修改了wd的文章: 如何使用Qt5,设置QLabel中字体的颜色. 大致有几种做法: 一是使用setPalette()方法: 二是使用样式表: 三是可以使用QStyle: 四是可以在其中使用一些简单的 ...

  4. 用cv::Scalar来设置opencv中图片的颜色

    1 怎样使用cv::Scalar来设置opencv中的颜色 cv::Scalar的构造函数是cv::Scalar(v1, v2, v3, v4),前面的三个参数是依次设置BGR的,和RGB相反,第四个 ...

  5. 我的python中级班学习之路(全程笔记第一模块) (第一章)(第2部分:如何设置python中的字体颜色,猜年龄练习题解答,while else语句,pycharm的使用)

    第一章:  python 基础语法 第  2  部分: 一.猜年龄练习题解答 直接上代码 >>> age = 26 >>> count = 0 >>&g ...

  6. 设置IDEA中各种线条颜色

    在IDEA之中, 如同TearLine, 行号, 搜索结果高亮, Caret Line, 方法分隔线颜色的设置的操作方法如下: 操作路径: 1.Ctrl+Alt+S, 打开设置:   settings ...

  7. e829. 获得和设置JTabbedPane 的卡片

    // To create a tabbed pane, see e828 创建JTabbedPane // Get the index of the currently selected tab in ...

  8. css设置input中placeholder字体

    设置input中placeholder字体颜色 input::-webkit-input-placeholder {color:@a;} input:-moz-placeholder {color:@ ...

  9. tabBar中tabBarItem选中颜色自定义设置

    1.在storyBoard中,选中tabBarController,设置tabBar中KeyPath中的(selectedImageTintColor)如图 2. 直接代码设置 tabBarContr ...

随机推荐

  1. android使用POI读写word doc文件

    目录 1     读word doc文件 1.1     通过WordExtractor读文件 1.2     通过HWPFDocument读文件 2     写word doc文件 Apache p ...

  2. Android,XML解析

    XML解析三种方式 DOM 通用性强,它会将XML文件的所有内容读取到内存中,然后允许您使用DOM API遍历XML树.检索所需的数据: 简单直观,但需要将文档读取到内存,并不太适合移动设备: SAX ...

  3. 为什么不能使用Executors.newFixedThreadPool和newCachedThreadPool

    newFixedThreadPool的阻塞队列大小是没有大小限制的,如果队列堆积数据太多会造成资源消耗.newCachedThreadPool是线程数量是没有大小限制的,当新的线程来了直接创建,同样会 ...

  4. H3C AP实现定时重启

    #job radio_diable  view system  time 1 repeating at 03:00 command wlan radio disable all  time 2 rep ...

  5. 6款漂亮HTML CSS样式用户留言表单

    如今我们的网站.页面更加需要注重细节,不论是字体的样式.还是图片的分辨率清晰度都会影响到用户的访问体验和PV,以及用户以后是否会回访我们的网站/博客.如果有时间的时候,老左也会浏览和阅读相关的前端网站 ...

  6. tf.placeholder

    tf.placeholder placeholder( dtype, shape=None, name=None ) 功能说明: 是一种占位符,在执行时候需要为其提供数据 参数列表: 参数名 必选 类 ...

  7. model number

    // test.cpp : Defines the entry point for the console application. // #include "stdafx.h" ...

  8. ASP.NET学习笔记(3)——用户增删改查(三层)

    说明(2017-10-6 11:21:58): 1. 十一放假在家也没写几行代码,本来还想着利用假期把asp.net看完,结果天天喝酒睡觉,回去的票也没买到,惨.. 2. 断断续续的把用户信息的页面写 ...

  9. mysql处理varchar类型的between和and的时间问题少一天解决;

    select * from table where CJSJ day),"%Y-%m-%d") 数据库中的时间类型是varchar,传入的类型也是string 上述sql的意思是: ...

  10. Thinkphp CURD中的where方法

    今天来给大家讲下查询最常用但也是最复杂的where方法,where方法也属于模型类的连贯操作方法之一,主要用于查询和操作条件的设置.where方法的用法是ThinkPHP查询语言的精髓,也是Think ...