e837. 设置JTabbedPane中卡片的颜色
// 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中卡片的颜色的更多相关文章
- 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 ...
- e834. 设置JTabbedPane中卡片的位置
The tabs of a tabbed pane can be placed on one of the four edges of its container. By default, when ...
- QT5如何设置QLabel中字体的颜色
修改了wd的文章: 如何使用Qt5,设置QLabel中字体的颜色. 大致有几种做法: 一是使用setPalette()方法: 二是使用样式表: 三是可以使用QStyle: 四是可以在其中使用一些简单的 ...
- 用cv::Scalar来设置opencv中图片的颜色
1 怎样使用cv::Scalar来设置opencv中的颜色 cv::Scalar的构造函数是cv::Scalar(v1, v2, v3, v4),前面的三个参数是依次设置BGR的,和RGB相反,第四个 ...
- 我的python中级班学习之路(全程笔记第一模块) (第一章)(第2部分:如何设置python中的字体颜色,猜年龄练习题解答,while else语句,pycharm的使用)
第一章: python 基础语法 第 2 部分: 一.猜年龄练习题解答 直接上代码 >>> age = 26 >>> count = 0 >>&g ...
- 设置IDEA中各种线条颜色
在IDEA之中, 如同TearLine, 行号, 搜索结果高亮, Caret Line, 方法分隔线颜色的设置的操作方法如下: 操作路径: 1.Ctrl+Alt+S, 打开设置: settings ...
- e829. 获得和设置JTabbedPane 的卡片
// To create a tabbed pane, see e828 创建JTabbedPane // Get the index of the currently selected tab in ...
- css设置input中placeholder字体
设置input中placeholder字体颜色 input::-webkit-input-placeholder {color:@a;} input:-moz-placeholder {color:@ ...
- tabBar中tabBarItem选中颜色自定义设置
1.在storyBoard中,选中tabBarController,设置tabBar中KeyPath中的(selectedImageTintColor)如图 2. 直接代码设置 tabBarContr ...
随机推荐
- 详细介绍Base64的编码转换方式
下面,详细介绍Base64的编码转换方式. 所谓Base64,就是说选出64个字符----小写字母a-z.大写字母A-Z.数字0-9.符号"+"."/"(再加上 ...
- VS2015终极卸载方法
今天打开VS2015发现出问题了,总是停止响应,去控制面板里卸载结果像下面这样,卸载出错!于是我有开始折腾了,重新安装一遍然后,还是有问题,在卸载还是出错于是我决定通过安装介质卸载,结果,悲剧的是,启 ...
- 【Socket】linux黑客之网络嗅探底层原理
1.mystery引入 1)网络嗅探属于网络攻防类的安全软件,其基于原始套接字技术开发的 2)原始套接字是一种套接字底层技术,它工作在网络层 3)谈到网络安全,刚好本学期学过这门课程,这里myst ...
- strrchr()函数
函数简介 函数名称: strrchr 函数原型:char *strrchr(const char *str, char c); 所属库: string.h 函数功能:查找一个字符c在另一个字符串str ...
- Excel工作记录表制作
前言:我们一天中的工作可能特别忙.事情特别多,这时候你就要像CPU一样去调度.去执行任务,但总要有个地方记录你的执行情况,这就需要我们自己去记录和管理了,下面是使用excel的简单管理记录方式,下图是 ...
- border属性
border 简写属性,用于把针对四个边框的属性设置在一个声明里 border-style 用于元素所有边框的样式,或者单独的为各边框设置样式 border-width 简写属性,用于为元素的所有边框 ...
- jQuery实现radio第一次点击选中第二次点击取消功能(转)
转载自:http://www.jb51.net/article/113730.htm 由于项目的需求,要求radio点击两次后为取消状态,不方便修改为checkbox,可以用正面的方法实现. // j ...
- Mac OS X上如何实现到Linux主机的ssh免登陆
转载说明: 本文转载自 http://www.aips.me/mac-key-ssh-login-linux.html 生成密钥对 用密码登录远程主机,将公钥拷贝过去 done 第一步:生成密匙对执行 ...
- TED Notes 1 (What leads to success)
1. the first thing is passion, do it for love, not for money2. if you do it for love, the money come ...
- git log 关键字查找
最近再搞 224 byte oob的 nandflash , 就查看一下 更新的 u-boot 有没有关于这方面的更新. 查找含有某个字符串的 commit git log --grep=224 // ...