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 ...
随机推荐
- 微信JSAPI 公众号支付 H5支付以及APP支付 WEBAPI接口开发测试
统一下单入口 调用该方法入口: public void WxPayAPI() { //string PayPrice ="99.9"; ////订单号 //string Payor ...
- linux命令(47):Linux下对文件进行按行排序,去除重复行
Linux下对文件进行按行排序:sort 与 uniq 命令简介 Linux | May 24, 2015 | linux sort 命令可针对文本文件的内容,以行为单位进行排序.其基本语法格式为: ...
- hive一行变多行及多行变一行
hive一行变多行及多行变一行 场景 name alias zhaoqiansun abc def ghi 处理数据时需要将上表处理成为下面的形式: name alias zhaoqiansun ab ...
- maven pom scope 含义
maven pom scope 依赖范围控制哪些依赖在哪些classpath 中可用,哪些依赖包含在一个应用中.让我们详细看一下每一种范围: compile (编译范围) compile是默认的范围: ...
- django模型创建
定义模型 模型,属性,表,字段之间的关系 一个模型类在数据库中对应一张表,在模型类中定义的属性,对应该模型对照表中的一个字段 定义属性:见下文 创建模型类 元选项 在模型类中定义Meta类,用于设置元 ...
- SQL中的DML、DDL以及DCL是什么?
DML(data manipulation language)是数据操纵语言:它们是SELECT.UPDATE.INSERT.DELETE,就象它的名字一样,这4条命令是用来对数据库里的数据进行操作的 ...
- ubuntu 安装 sshd
ubuntu 上可以安装 SSHD 服务,方便远程操作. sudo apt-get update sudo apt-get install openssh-server sudo /etc/init. ...
- Deepin Linux已经做得相当不错了
很庆幸,用了MacBook Pro三四年后,还会想要用Linux做桌面,一方面说明自己还是年轻的,保持着愿意折腾的心态:另一方面,也确实发现macOS的桌面环境并不如传说中的稳定和好用. Deepin ...
- Android——线程通讯类Handler(转)
原文地址:http://uule.iteye.com/blog/1705951 handler是线程通讯工具类.用于传递消息.它有两个队列:1.消息队列2.线程队列 消息队列使用sendMessage ...
- CPP_const&static
const 1. 定义本地常量,替换宏.#define LENGHTH 16static const int LENGHTH = 16;2. const出现在星号左边,表示被指物是常量:const出现 ...