e870. 获取默认外观的数据
This example demonstrates how to retrieve all the default values for the current look and feel.
// Get the currently installed look and feel
UIDefaults uidefs = UIManager.getLookAndFeelDefaults(); // Retrieve the keys. Can't use an iterator since the map
// may be modified during the iteration. So retrieve all at once.
String[] keys = (String[])uidefs.keySet().toArray(new String[0]); for (int i=0; i<keys.length; i++) {
Object v = uidefs.get(keys[i]); if (v instanceof Integer) {
int intVal = uidefs.getInt(keys[i]);
} else if (v instanceof Boolean) {
boolean boolVal = uidefs.getBoolean(keys[i]);
} else if (v instanceof String) {
String strVal = uidefs.getString(keys[i]);
} else if (v instanceof Dimension) {
Dimension dimVal = uidefs.getDimension(keys[i]);
} else if (v instanceof Insets) {
Insets insetsVal = uidefs.getInsets(keys[i]);
} else if (v instanceof Color) {
Color colorVal = uidefs.getColor(keys[i]);
} else if (v instanceof Font) {
Font fontVal = uidefs.getFont(keys[i]);
} else if (v instanceof Border) {
Border borderVal = uidefs.getBorder(keys[i]);
} else if (v instanceof Icon) {
Icon iconVal = uidefs.getIcon(keys[i]);
} else if (v instanceof javax.swing.text.JTextComponent.KeyBinding[]) {
javax.swing.text.JTextComponent.KeyBinding[] keyBindsVal =
(javax.swing.text.JTextComponent.KeyBinding[])uidefs.get(keys[i]);
} else if (v instanceof InputMap) {
InputMap imapVal = (InputMap)uidefs.get(keys[i]);
} else {
// Unknown type
}
}
Related Examples |
e870. 获取默认外观的数据的更多相关文章
- 传递多个参数并获取Web API的数据
近段时间学习Web Api觉得非常有意思.默认的路由情况之下,获取数据时,它不必指定Action操作名. 还有另外感想,就是自从学习asp.net MVC之后,加上jQuery,让Insus.NET已 ...
- 在C#中使用正则表达式自动匹配并获取所需要的数据
转自:http://my.oschina.net/bv10000/blog/111736 正则表达式能根据设置匹配各种数据(比如:e-mail地址,电话号码,身份中号码等等).正则表达式功能强大,使用 ...
- 基于BootStrap的initupload()实现Excel上传和获取excel中的数据
简单说明:后边要做exl解析(还没做呢),所以先有一个excel的的上传以及获取excel中的数据,展示出来. 代码: //html代码 <div class="btn-group&q ...
- ASP.NET Core 2.2 : 十六.扒一扒新的Endpoint路由方案 try.dot.net 的正确使用姿势 .Net NPOI 根据excel模板导出excel、直接生成excel .Net NPOI 上传excel文件、提交后台获取excel里的数据
ASP.NET Core 2.2 : 十六.扒一扒新的Endpoint路由方案 ASP.NET Core 从2.2版本开始,采用了一个新的名为Endpoint的路由方案,与原来的方案在使用上差别不 ...
- Android中WebView的跨域漏洞分析和应用被克隆问题情景还原(免Root获取应用沙盒数据)
一.前言 去年年底支付宝的被克隆漏洞被爆出,无独有偶就是腾讯干的,其实真正了解这个事件之后会发现,感觉是针对支付宝.因为这个漏洞找出肯定花费了很大劲,主要是因为支付宝的特殊业务需要开启了WebView ...
- bootstrapTable:获取选中行的数据
必须要有checkbox:true和singleSelect:true,然后就可以通过var row=$("#mytab").bootstrapTable('getSelectio ...
- window系统mysql安装后获取默认密码
未设置密码,获取默认密码方法 第一步:进去mysql根目录下,如果没有data文件夹可以新建一个,找不到my.ini文件也新建一个(在根目录下创建的my.ini,重新配置的参数会覆盖源文件的参数,所以 ...
- Recoil 默认值及数据级联的使用
Recoil 中默认值及数据间的依赖 通过 Atom 可方便地设置数据的默认值, const fontSizeState = atom({ key: 'fontSizeState', default: ...
- 使用 shell 脚本自动获取发版指标数据
问题背景 大一点的公司都会建立一套规章流程来避免低级错误,例如合入代码前必需经过同行评审:上线前必需提测且通过 QA 验证:全量前必需经过 1%.5%.10%.20%.50% 的灰度过程.尤其是最后一 ...
随机推荐
- angular内置过滤器-filter
这篇文章来讲解一下angular内置的filter过滤器. 没错,这个过滤器的名字,就叫'filter',虽然自定义过滤器也是使用module.filter()...但是不要混淆了,这个filter就 ...
- javascript基础拾遗(八)
1.原型继承 如何让一个对象继承另一个对象? function Language(name){ this.name = name this.score = 8.0 } Language.prototy ...
- iOS开发transform的使用
// // ViewController.m // 18-transform的使用 #import "ViewController.h" @interface ViewCont ...
- css3 loading 效果
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 前端复制粘贴clipBoard.js的使用
<!DOCTYPE html> <html> <head> <title>ClipBoard.js使用:修改HTML</title> < ...
- Python+SparkStreaming+kafka+写入本地文件案例(可执行)
从kafka中读取指定的topic,根据中间内容的不同,写入不同的文件中. 文件按照日期区分. #!/usr/bin/env python # -*- coding: utf-8 -*- # @Tim ...
- LeetCode: Triangle 解题报告
Triangle Given a triangle, find the minimum path sum from top to bottom. Each step you may move to a ...
- 修改AIX Noncomp内存占用比
解决AIX系统由于文件缓存在内存未释放引发的进程异常终止问题: topas: Noncomp占用过多内存 占用内存前十的进程: ps -ealf | head -1 ; ps -ealf | sort ...
- iOS开发中的压缩以及解压
事实上,在iOS开发中,压缩与解压,我都是采用第三方框架SSZipArchive实现的 gitHub地址: https://github.com/ZipArchive/ZipArchive 上面有 ...
- WebSocket的Cookie问题(转)
问题:我用Nginx作静态服务器,Node.js监听另外端口作WebSocket服务器,客户端创建实例时,如果origin和host不一样的话,req实例的headers中没有cookie… ###解 ...