⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 e870. getting the default values for a look and feel.txt

📁 这里面包含了一百多个JAVA源文件
💻 TXT
字号:
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
        }
    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -