JTextComponent.KeyBinding : JTextComponent « javax.swing « Java by API






JTextComponent.KeyBinding

  


import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Insets;

import javax.swing.Icon;
import javax.swing.InputMap;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.text.JTextComponent;

public class Main {
  public static void main(String[] argv) {
    UIDefaults uidefs = UIManager.getLookAndFeelDefaults();
    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[]) {
        JTextComponent.KeyBinding[] keyBindsVal = (JTextComponent.KeyBinding[]) uidefs
            .get(keys[i]);
      } else if (v instanceof InputMap) {
        InputMap imapVal = (InputMap) uidefs.get(keys[i]);
      } else {
        System.out.println("Unknown type"); 
      }
    }
  }
}

   
    
  








Related examples in the same category

1.JTextComponent: addCaretListener(CaretListener listener)
2.JTextComponent: getActions()
3.JTextComponent: getCaretPosition()
4.JTextComponent: getDocument()
5.JTextComponent: getHighlighter()
6.JTextComponent: getSelectedText()
7.JTextComponent: getText(int offs, int len)
8.JTextComponent: moveCaretPosition(int pos)
9.JTextComponent: print(MessageFormat headerFormat, MessageFormat footerFormat, boolean showPrintDialog, PrintService service, PrintRequestAttributeSet attributes, boolean interactive)
10.JTextComponent: read(Reader in, Object desc)
11.JTextComponent: replaceSelection(String content)
12.JTextComponent: select(int selectionStart, int selectionEnd)
13.JTextComponent: setDocument(Document doc)
14.JTextComponent: setDragEnabled(boolean b)
15.JTextComponent: setFocusAccelerator(char aKey)
16.JTextComponent: setNavigationFilter(NavigationFilter filter)
17.JTextComponent: setSelectedTextColor(Color c)
18.JTextComponent: setSelectionColor(Color c)
19.JTextComponent: setSelectionEnd(int selectionEnd)
20.JTextComponent: setSelectionStart(int selectionStart)
21.JTextComponent: write(Writer out)