// 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. ossec变更alert等级及配置邮件预警

    一.场景 当攻击者尝试使用字典对某一台主机的sshd服务进行暴力破解的时候,如果我们能第一时间受到攻击预警的邮件的话,对安全人员或者运维人员来说都能做出快速响应.而使用ossec恰巧可以完成这一工作, ...

  2. C++11 类型推导auto

    在C++11之前,auto关键字用来指定存储期.在新标准中,它的功能变为类型推断.auto现在成了一个类型的占位符,通知编译器去根据初始化代码推断所声明变量的真实类型.使用auto会拖慢c++效率吗? ...

  3. Vue.js使用-http请求

    Vue.js使用-ajax使用 1.为什么要使用ajax 前面的例子,使用的是本地模拟数据,通过ajax请求服务器数据. 2.使用jquery的ajax库示例 new Vue({ el: '#app' ...

  4. 原生js实现文件上传

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

  5. pthread之线程堆栈

    转:http://blog.csdn.net/horstlinux/article/details/7666032 //先来讲说线程内存相关的东西,主要有下面几条: //进程中的所有的线程共享相同的地 ...

  6. 查看chekpoit文件

    使用tf.train.Saver()保存到checkpoint文件,我们可以用tensorflow查看. # import the inspect_checkpoint library from te ...

  7. splitter 使用

    splitter1.Width = ; splitter1.Height = ; Label l = new Label(); l.Text = "···"; //写入的字,具体指 ...

  8. [转]ORA-01555错误总结(二)

    原文地址:http://blog.csdn.net/oradh/article/details/25683769 这篇文章紧接着上一篇“ORA-01555错误总结(一)”,主要描述延迟块清除导致的OR ...

  9. 【Unity】使用Resources类管理资源

    最近参考了各位大神的资源,初步学习了Unity的资源管理模式,包括在编辑器管理(使用AssetDatabase)和在运行时管理(使用Resources和AssetBundle).在此简单总结运行时用R ...

  10. Linux 获取 MAC 地址并去除 : 字符

    ifconfig -a | grep eth0 | awk -F ' ' '{print $5}' | sed 's/://g'