Examples of VKeyboard


Examples of de.t68.utils.keyboard.VKeyboard

        keyboardTextField.setText(original.getText());
        if (popup == null)
        {
            popup = new JPopupMenu();
            KeyboardLayout layout = LanguageMap.getInstance().getKeyboardLayoutForCurrentLocale();
            VKeyboard keyboard = new VKeyboard(layout, keyFontSize, keyboardTextField);
            popup.add(keyboard);
            popup.pack();
        }
        popup.show(original, 0, 0);
    }
View Full Code Here

Examples of de.t68.utils.keyboard.VKeyboard

        f.getContentPane().setLayout(new BorderLayout());
        f.getContentPane().add(p, BorderLayout.CENTER);
        final LanguageMap map = LanguageMap.getInstance();

        KeyboardLayout layout = map.getKeyboardLayoutForLocale("th", "TH");
        final VKeyboard v = new VKeyboard(layout, tb);
        JPanel panel = new JPanel(new BorderLayout());
        panel.add(v.getKeyPanel(), BorderLayout.CENTER);
        final JComboBox<String> comboBox = new JComboBox<>(new Vector<>(map.keySet()));
        comboBox.setFocusable(false);
        JPanel boxPanel = new JPanel(new FlowLayout());
        boxPanel.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 20));
        boxPanel.add(comboBox);
        panel.add(boxPanel, BorderLayout.NORTH);
        comboBox.setSelectedItem(layout.getLocaleString().get(0));
        comboBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e)
            {
                Object item = comboBox.getSelectedItem();
                if (item instanceof String)
                {
                    KeyboardLayout keyboardLayout = map.get(item);
                    if (keyboardLayout != null)
                        v.setKeyboardLayout(keyboardLayout);
                }
            }
        });
        p.add(tb, BorderLayout.NORTH);
        p.add(panel, BorderLayout.CENTER);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.