List of usage examples for java.awt.event KeyEvent VK_UNDEFINED
int VK_UNDEFINED
To view the source code for java.awt.event KeyEvent VK_UNDEFINED.
Click Source Link
From source file:Main.java
public static void updateToggleMnemonic(JComponent c, int oldKey, int newKey) { if (oldKey == newKey) { return;//from ww w. j a v a 2s. c o m } InputMap map = c.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); if (map != null && oldKey != 0) { map.remove(KeyStroke.getKeyStroke(oldKey, KeyEvent.ALT_MASK, false)); map.remove(KeyStroke.getKeyStroke(oldKey, KeyEvent.ALT_MASK, true)); map.remove(KeyStroke.getKeyStroke(oldKey, KeyEvent.VK_UNDEFINED, true)); } if (newKey != 0) { if (map == null) { map = new ComponentInputMap(c); c.setInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW, map); } map.put(KeyStroke.getKeyStroke(newKey, KeyEvent.ALT_MASK, false), "press"); map.put(KeyStroke.getKeyStroke(newKey, KeyEvent.ALT_MASK, true), "release"); map.put(KeyStroke.getKeyStroke(newKey, KeyEvent.VK_UNDEFINED, true), "release"); } }
From source file:com.sec.ose.osi.ui.frm.login.JPanLogin.java
/** * This method initializes jPanelUserInfo * //w w w.j av a 2 s . c o m * @return javax.swing.JPanel */ private JPanel getJPanelUserInfo() { if (jPanelUserInfo == null) { jPanelUserInfo = new JPanel(); jPanelUserInfo.setLayout(new GridBagLayout()); // User ID JLabel jLabelUser = new JLabel("User ID:"); jLabelUser.setHorizontalAlignment(SwingConstants.RIGHT); jLabelUser.setText("User ID :"); jLabelUser.setEnabled(true); GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridy = 0; gridBagConstraints.gridx = 0; gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new Insets(0, 10, 0, 0); jPanelUserInfo.add(jLabelUser, gridBagConstraints); GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); gridBagConstraints1.fill = GridBagConstraints.BOTH; gridBagConstraints1.gridy = 0; gridBagConstraints1.gridx = 1; gridBagConstraints1.weightx = 1.0; gridBagConstraints1.insets = new Insets(5, 5, 5, 5); jPanelUserInfo.add(getJTextFieldUser(), gridBagConstraints1); // Password JLabel jLabelPwd = new JLabel(); jLabelPwd.setText("Password :"); jLabelPwd.setHorizontalAlignment(SwingConstants.RIGHT); GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); gridBagConstraints2.gridy = 1; gridBagConstraints2.gridx = 0; gridBagConstraints2.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints2.insets = new Insets(0, 10, 0, 0); jPanelUserInfo.add(jLabelPwd, gridBagConstraints2); GridBagConstraints gridBagConstraints3 = new GridBagConstraints(); gridBagConstraints3.fill = GridBagConstraints.BOTH; gridBagConstraints3.gridy = 1; gridBagConstraints3.gridx = 1; gridBagConstraints3.weightx = 1.0; gridBagConstraints3.insets = new Insets(5, 5, 5, 5); jPanelUserInfo.add(getJPasswordField(), gridBagConstraints3); // Protex Server IP JLabel jLabelServer = new JLabel(); jLabelServer.setText("Protex Server IP :"); jLabelServer.setHorizontalAlignment(SwingConstants.RIGHT); jLabelServer.setDisplayedMnemonic(KeyEvent.VK_UNDEFINED); GridBagConstraints gridBagConstraints11 = new GridBagConstraints(); gridBagConstraints11.gridy = 2; gridBagConstraints11.gridx = 0; gridBagConstraints11.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints11.insets = new Insets(0, 10, 5, 0); jPanelUserInfo.add(jLabelServer, gridBagConstraints11); GridBagConstraints gridBagConstraints21 = new GridBagConstraints(); gridBagConstraints21.gridy = 2; gridBagConstraints21.gridx = 1; gridBagConstraints21.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints21.insets = new Insets(5, 5, 10, 5); jPanelUserInfo.add(getJTextFieldServerIP(), gridBagConstraints21); } return jPanelUserInfo; }
From source file:com.nbt.TreeFrame.java
private void createActions() { newAction = new NBTAction("New", "New", "New", KeyEvent.VK_N) { {/*from www . ja v a2 s .c o m*/ putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke('N', Event.CTRL_MASK)); } @Override public void actionPerformed(ActionEvent e) { updateTreeTable(new CompoundTag("")); } }; browseAction = new NBTAction("Browse...", "Open", "Browse...", KeyEvent.VK_O) { { putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke('O', Event.CTRL_MASK)); } @Override public void actionPerformed(ActionEvent e) { JFileChooser fc = createFileChooser(); switch (fc.showOpenDialog(TreeFrame.this)) { case JFileChooser.APPROVE_OPTION: File file = fc.getSelectedFile(); Preferences prefs = getPreferences(); prefs.put(KEY_FILE, file.getAbsolutePath()); doImport(file); break; } } }; saveAction = new NBTAction("Save", "Save", "Save", KeyEvent.VK_S) { { putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke('S', Event.CTRL_MASK)); } @Override public void actionPerformed(ActionEvent e) { String path = textFile.getText(); File file = new File(path); if (file.canWrite()) { doExport(file); } else { saveAsAction.actionPerformed(e); } } }; saveAsAction = new NBTAction("Save As...", "SaveAs", "Save As...", KeyEvent.VK_UNDEFINED) { public void actionPerformed(ActionEvent e) { JFileChooser fc = createFileChooser(); switch (fc.showSaveDialog(TreeFrame.this)) { case JFileChooser.APPROVE_OPTION: File file = fc.getSelectedFile(); Preferences prefs = getPreferences(); prefs.put(KEY_FILE, file.getAbsolutePath()); doExport(file); break; } } }; refreshAction = new NBTAction("Refresh", "Refresh", "Refresh", KeyEvent.VK_F5) { { putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke("F5")); } public void actionPerformed(ActionEvent e) { String path = textFile.getText(); File file = new File(path); if (file.canRead()) doImport(file); else showErrorDialog("The file could not be read."); } }; exitAction = new NBTAction("Exit", "Exit", KeyEvent.VK_ESCAPE) { @Override public void actionPerformed(ActionEvent e) { // TODO: this should check to see if any changes have been made // before exiting System.exit(0); } }; cutAction = new DefaultEditorKit.CutAction() { { String name = "Cut"; putValue(NAME, name); putValue(SHORT_DESCRIPTION, name); putValue(MNEMONIC_KEY, KeyEvent.VK_X); putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke('X', Event.CTRL_MASK)); ImageFactory factory = new ImageFactory(); try { putValue(SMALL_ICON, new ImageIcon(factory.readGeneralImage(name, NBTAction.smallIconSize))); } catch (IOException e) { e.printStackTrace(); } try { putValue(LARGE_ICON_KEY, new ImageIcon(factory.readGeneralImage(name, NBTAction.largeIconSize))); } catch (IOException e) { e.printStackTrace(); } } }; copyAction = new DefaultEditorKit.CopyAction() { { String name = "Copy"; putValue(NAME, name); putValue(SHORT_DESCRIPTION, name); putValue(MNEMONIC_KEY, KeyEvent.VK_C); putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke('C', Event.CTRL_MASK)); ImageFactory factory = new ImageFactory(); try { putValue(SMALL_ICON, new ImageIcon(factory.readGeneralImage(name, NBTAction.smallIconSize))); } catch (IOException e) { e.printStackTrace(); } try { putValue(LARGE_ICON_KEY, new ImageIcon(factory.readGeneralImage(name, NBTAction.largeIconSize))); } catch (IOException e) { e.printStackTrace(); } } }; pasteAction = new DefaultEditorKit.CutAction() { { String name = "Paste"; putValue(NAME, name); putValue(SHORT_DESCRIPTION, name); putValue(MNEMONIC_KEY, KeyEvent.VK_V); putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke('V', Event.CTRL_MASK)); ImageFactory factory = new ImageFactory(); try { putValue(SMALL_ICON, new ImageIcon(factory.readGeneralImage(name, NBTAction.smallIconSize))); } catch (IOException e) { e.printStackTrace(); } try { putValue(LARGE_ICON_KEY, new ImageIcon(factory.readGeneralImage(name, NBTAction.largeIconSize))); } catch (IOException e) { e.printStackTrace(); } } }; deleteAction = new NBTAction("Delete", "Delete", "Delete", KeyEvent.VK_DELETE) { { putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke("DELETE")); } public void actionPerformed(ActionEvent e) { int row = treeTable.getSelectedRow(); TreePath path = treeTable.getPathForRow(row); Object last = path.getLastPathComponent(); if (last instanceof NBTFileBranch) { NBTFileBranch branch = (NBTFileBranch) last; File file = branch.getFile(); String name = file.getName(); String message = "Are you sure you want to delete " + name + "?"; String title = "Continue?"; int option = JOptionPane.showConfirmDialog(TreeFrame.this, message, title, JOptionPane.OK_CANCEL_OPTION); switch (option) { case JOptionPane.CANCEL_OPTION: return; } if (!FileUtils.deleteQuietly(file)) { showErrorDialog(name + " could not be deleted."); return; } } TreePath parentPath = path.getParentPath(); Object parentLast = parentPath.getLastPathComponent(); NBTTreeTableModel model = treeTable.getTreeTableModel(); int index = model.getIndexOfChild(parentLast, last); if (parentLast instanceof Mutable<?>) { Mutable<?> mutable = (Mutable<?>) parentLast; if (last instanceof ByteWrapper) { ByteWrapper wrapper = (ByteWrapper) last; index = wrapper.getIndex(); } mutable.remove(index); } else { System.err.println(last.getClass()); return; } updateTreeTable(); treeTable.expandPath(parentPath); scrollTo(parentLast); treeTable.setRowSelectionInterval(row, row); } }; openAction = new NBTAction("Open...", "Open...", KeyEvent.VK_T) { { putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke('T', Event.CTRL_MASK)); final int diamondPickaxe = 278; SpriteRecord record = NBTTreeTable.register.getRecord(diamondPickaxe); BufferedImage image = record.getImage(); setSmallIcon(image); int width = 24, height = 24; Dimension size = new Dimension(width, height); Map<RenderingHints.Key, ?> hints = Thumbnail.createRenderingHints(Thumbnail.QUALITY); BufferedImage largeImage = Thumbnail.createThumbnail(image, size, hints); setLargeIcon(largeImage); } public void actionPerformed(ActionEvent e) { TreePath path = treeTable.getPath(); if (path == null) return; Object last = path.getLastPathComponent(); if (last instanceof Region) { Region region = (Region) last; createAndShowTileCanvas(new TileCanvas.TileWorld(region)); return; } else if (last instanceof World) { World world = (World) last; createAndShowTileCanvas(world); return; } if (last instanceof NBTFileBranch) { NBTFileBranch fileBranch = (NBTFileBranch) last; File file = fileBranch.getFile(); try { open(file); } catch (IOException ex) { ex.printStackTrace(); showErrorDialog(ex.getMessage()); } } } private void open(File file) throws IOException { if (Desktop.isDesktopSupported()) { Desktop desktop = Desktop.getDesktop(); if (desktop.isSupported(Desktop.Action.OPEN)) { desktop.open(file); } } } }; addByteAction = new NBTAction("Add Byte", NBTConstants.TYPE_BYTE, "Add Byte", KeyEvent.VK_1) { { putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke('1', Event.CTRL_MASK)); } public void actionPerformed(ActionEvent e) { addTag(new ByteTag("new byte", (byte) 0)); } }; addShortAction = new NBTAction("Add Short", NBTConstants.TYPE_SHORT, "Add Short", KeyEvent.VK_2) { { putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke('2', Event.CTRL_MASK)); } public void actionPerformed(ActionEvent e) { addTag(new ShortTag("new short", (short) 0)); } }; addIntAction = new NBTAction("Add Integer", NBTConstants.TYPE_INT, "Add Integer", KeyEvent.VK_3) { { putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke('3', Event.CTRL_MASK)); } public void actionPerformed(ActionEvent e) { addTag(new IntTag("new int", 0)); } }; addLongAction = new NBTAction("Add Long", NBTConstants.TYPE_LONG, "Add Long", KeyEvent.VK_4) { { putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke('4', Event.CTRL_MASK)); } public void actionPerformed(ActionEvent e) { addTag(new LongTag("new long", 0)); } }; addFloatAction = new NBTAction("Add Float", NBTConstants.TYPE_FLOAT, "Add Float", KeyEvent.VK_5) { { putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke('5', Event.CTRL_MASK)); } public void actionPerformed(ActionEvent e) { addTag(new FloatTag("new float", 0)); } }; addDoubleAction = new NBTAction("Add Double", NBTConstants.TYPE_DOUBLE, "Add Double", KeyEvent.VK_6) { { putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke('6', Event.CTRL_MASK)); } public void actionPerformed(ActionEvent e) { addTag(new DoubleTag("new double", 0)); } }; addByteArrayAction = new NBTAction("Add Byte Array", NBTConstants.TYPE_BYTE_ARRAY, "Add Byte Array", KeyEvent.VK_7) { { putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke('7', Event.CTRL_MASK)); } public void actionPerformed(ActionEvent e) { addTag(new ByteArrayTag("new byte array")); } }; addStringAction = new NBTAction("Add String", NBTConstants.TYPE_STRING, "Add String", KeyEvent.VK_8) { { putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke('8', Event.CTRL_MASK)); } public void actionPerformed(ActionEvent e) { addTag(new StringTag("new string", "...")); } }; addListAction = new NBTAction("Add List Tag", NBTConstants.TYPE_LIST, "Add List Tag", KeyEvent.VK_9) { { putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke('9', Event.CTRL_MASK)); } public void actionPerformed(ActionEvent e) { Class<? extends Tag> type = queryType(); if (type != null) addTag(new ListTag("new list", null, type)); } private Class<? extends Tag> queryType() { Object[] items = { NBTConstants.TYPE_BYTE, NBTConstants.TYPE_SHORT, NBTConstants.TYPE_INT, NBTConstants.TYPE_LONG, NBTConstants.TYPE_FLOAT, NBTConstants.TYPE_DOUBLE, NBTConstants.TYPE_BYTE_ARRAY, NBTConstants.TYPE_STRING, NBTConstants.TYPE_LIST, NBTConstants.TYPE_COMPOUND }; JComboBox comboBox = new JComboBox(new DefaultComboBoxModel(items)); comboBox.setRenderer(new DefaultListCellRenderer() { @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); if (value instanceof Integer) { Integer i = (Integer) value; Class<? extends Tag> c = NBTUtils.getTypeClass(i); String name = NBTUtils.getTypeName(c); setText(name); } return this; } }); Object[] message = { new JLabel("Please select a type."), comboBox }; String title = "Title goes here"; int result = JOptionPane.showOptionDialog(TreeFrame.this, message, title, JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null); switch (result) { case JOptionPane.OK_OPTION: ComboBoxModel model = comboBox.getModel(); Object item = model.getSelectedItem(); if (item instanceof Integer) { Integer i = (Integer) item; return NBTUtils.getTypeClass(i); } } return null; } }; addCompoundAction = new NBTAction("Add Compound Tag", NBTConstants.TYPE_COMPOUND, "Add Compound Tag", KeyEvent.VK_0) { { putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke('0', Event.CTRL_MASK)); } public void actionPerformed(ActionEvent e) { addTag(new CompoundTag()); } }; String name = "About " + TITLE; helpAction = new NBTAction(name, "Help", name, KeyEvent.VK_F1) { { putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke("F1")); } public void actionPerformed(ActionEvent e) { Object[] message = { new JLabel(TITLE + " " + VERSION), new JLabel("\u00A9 Copyright Taggart Spilman 2011. All rights reserved."), new Hyperlink("<html><a href=\"#\">NamedBinaryTag.com</a></html>", "http://www.namedbinarytag.com"), new Hyperlink("<html><a href=\"#\">Contact</a></html>", "mailto:tagadvance@gmail.com"), new JLabel(" "), new Hyperlink("<html><a href=\"#\">JNBT was written by Graham Edgecombe</a></html>", "http://jnbt.sf.net"), new Hyperlink("<html><a href=\"#\">Available open-source under the BSD license</a></html>", "http://jnbt.sourceforge.net/LICENSE.TXT"), new JLabel(" "), new JLabel("This product includes software developed by"), new Hyperlink("<html><a href=\"#\">The Apache Software Foundation</a>.</html>", "http://www.apache.org"), new JLabel(" "), new JLabel("Default texture pack:"), new Hyperlink("<html><a href=\"#\">SOLID COLOUR. SOLID STYLE.</a></html>", "http://www.minecraftforum.net/topic/72253-solid-colour-solid-style/"), new JLabel("Bundled with the permission of Trigger_Proximity."), }; String title = "About"; JOptionPane.showMessageDialog(TreeFrame.this, message, title, JOptionPane.INFORMATION_MESSAGE); } }; }
From source file:com.net2plan.gui.GUINet2Plan.java
private void start() { setExtendedState(JFrame.MAXIMIZED_BOTH); setMinimumSize(new Dimension(800, 600)); itemObject = new DualHashBidiMap<JMenuItem, Object>(); URL iconURL = GUINet2Plan.class.getResource("/resources/gui/icon.png"); ImageIcon icon = new ImageIcon(iconURL); setIconImage(icon.getImage());// w w w .j a va2s.co m setTitle("Net2Plan"); setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); addWindowListener(CLOSE_NET2PLAN); getContentPane().setLayout(new MigLayout("insets 0 0 0 0", "[grow]", "[grow]")); container = new JPanel(new MigLayout("", "[]", "[]")); container.setBorder(new LineBorder(Color.BLACK)); container.setLayout(new MigLayout("fill")); getContentPane().add(container, "grow"); /* Create menu bar */ menu = new JMenuBar(); setJMenuBar(menu); /* File menu */ JMenu file = new JMenu("File"); file.setMnemonic('F'); menu.add(file); optionsItem = new JMenuItem("Options"); optionsItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.ALT_DOWN_MASK)); optionsItem.addActionListener(this); file.add(optionsItem); classPathEditorItem = new JMenuItem("Classpath editor"); classPathEditorItem.addActionListener(this); file.add(classPathEditorItem); errorConsoleItem = new JMenuItem("Show Java console"); errorConsoleItem.addActionListener(this); errorConsoleItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F12, InputEvent.ALT_DOWN_MASK)); file.add(errorConsoleItem); exitItem = new JMenuItem("Exit"); exitItem.addActionListener(this); exitItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F4, InputEvent.ALT_DOWN_MASK)); file.add(exitItem); /* Help menu */ JMenu help = new JMenu("Help"); help.setMnemonic('H'); menu.add(help); aboutItem = new JMenuItem("About"); aboutItem.addActionListener(this); help.add(aboutItem); itemObject.put(aboutItem, showAbout()); helpItem = new JMenuItem("User's guide"); helpItem.addActionListener(this); helpItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F1, KeyEvent.VK_UNDEFINED)); help.add(helpItem); javadocItem = new JMenuItem("Library API Javadoc"); javadocItem.addActionListener(this); help.add(javadocItem); javadocExamplesItem = new JMenuItem("Built-in Examples Javadoc"); javadocExamplesItem.addActionListener(this); help.add(javadocExamplesItem); keyCombinationItem = new JMenuItem("Show tool key combinations"); keyCombinationItem.addActionListener(this); keyCombinationItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_K, KeyEvent.ALT_DOWN_MASK)); help.add(keyCombinationItem); usedKeyStrokes = new LinkedHashSet<KeyStroke>(); refreshMenu(); container.add(showAbout(), "align center"); container.revalidate(); new JFileChooser(); /* Do not remove! It is used to avoid slow JFileChooser first-time loading once Net2Plan is shown to the user */ setVisible(true); }
From source file:com.sec.ose.osi.ui.frm.login.JPanLogin.java
private JPanel getJPanelProxyInfo() { if (jPanelProxyInfo == null) { jPanelProxyInfo = new JPanel(); jPanelProxyInfo.setLayout(new GridBagLayout()); // Proxy Host JLabel jLabelProxyHost = new JLabel("Proxy Host :"); jLabelProxyHost.setHorizontalAlignment(SwingConstants.RIGHT); GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridy = 0;/*from ww w . java 2s . com*/ gridBagConstraints.gridx = 0; gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new Insets(0, 10, 0, 0); jPanelProxyInfo.add(jLabelProxyHost, gridBagConstraints); GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); gridBagConstraints1.fill = GridBagConstraints.BOTH; gridBagConstraints1.gridy = 0; gridBagConstraints1.gridx = 1; gridBagConstraints1.weightx = 0.5; gridBagConstraints1.insets = new Insets(5, 5, 5, 5); jPanelProxyInfo.add(getJTextProxyHost(), gridBagConstraints1); // Proxy Port JLabel jLabelProxyPort = new JLabel("Port :"); jLabelProxyPort.setHorizontalAlignment(SwingConstants.RIGHT); GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); gridBagConstraints2.gridy = 0; gridBagConstraints2.gridx = 2; gridBagConstraints2.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints2.insets = new Insets(0, 10, 0, 0); jPanelProxyInfo.add(jLabelProxyPort, gridBagConstraints2); GridBagConstraints gridBagConstraints3 = new GridBagConstraints(); gridBagConstraints3.fill = GridBagConstraints.BOTH; gridBagConstraints3.gridy = 0; gridBagConstraints3.gridx = 3; gridBagConstraints3.weightx = 0.5; gridBagConstraints3.insets = new Insets(5, 5, 5, 5); jPanelProxyInfo.add(getJTextProxyPort(), gridBagConstraints3); // Proxy Bypass JLabel jLabelProxyBypass = new JLabel(); jLabelProxyBypass.setText(" Proxy Bypass :"); jLabelProxyBypass.setHorizontalAlignment(SwingConstants.RIGHT); jLabelProxyBypass.setDisplayedMnemonic(KeyEvent.VK_UNDEFINED); GridBagConstraints gridBagConstraints11 = new GridBagConstraints(); gridBagConstraints11.gridy = 1; gridBagConstraints11.gridx = 0; gridBagConstraints11.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints11.insets = new Insets(0, 10, 5, 0); jPanelProxyInfo.add(jLabelProxyBypass, gridBagConstraints11); GridBagConstraints gridBagConstraints21 = new GridBagConstraints(); gridBagConstraints21.gridy = 1; gridBagConstraints21.gridx = 1; gridBagConstraints21.gridwidth = 3; //gridBagConstraints21.weightx = 1.0; gridBagConstraints21.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints21.insets = new Insets(5, 5, 10, 5); jPanelProxyInfo.add(getJTextProxyBypass(), gridBagConstraints21); } return jPanelProxyInfo; }
From source file:com.ixora.rms.ui.RMSFrame.java
/** * @return javax.swing.JButton/*from w ww .j a va 2 s . co m*/ */ private javax.swing.JButton getJButtonNewSession() { if (fButtonNewSession == null) { fButtonNewSession = UIFactoryMgr.createButton(this.fActionNewSession); fButtonNewSession.setText(null); fButtonNewSession.setMnemonic(KeyEvent.VK_UNDEFINED); } return fButtonNewSession; }
From source file:com.ixora.rms.ui.RMSFrame.java
/** * @return javax.swing.JButton//w w w . ja v a 2 s .c om */ private ButtonWithPopup getJButtonLoadScheme() { if (fButtonLoadSession == null) { fButtonLoadSession = new ButtonWithPopupLoadScheme(this.fActionLoadSession); fButtonLoadSession.setText(null); fButtonLoadSession.setMnemonic(KeyEvent.VK_UNDEFINED); } return fButtonLoadSession; }
From source file:com.ixora.rms.ui.RMSFrame.java
/** * @return javax.swing.JButton/* www . j a v a2 s . c o m*/ */ private javax.swing.JButton getJButtonLoadLog() { if (fButtonLoadLog == null) { fButtonLoadLog = UIFactoryMgr.createButton(this.fActionLoadLog); fButtonLoadLog.setText(null); fButtonLoadLog.setMnemonic(KeyEvent.VK_UNDEFINED); } return fButtonLoadLog; }
From source file:com.ixora.rms.ui.RMSFrame.java
/** * @return javax.swing.JButton/*w ww . j a va 2 s . co m*/ */ private javax.swing.JButton getJButtonCompareLogs() { if (fButtonCompareLogs == null) { fButtonCompareLogs = UIFactoryMgr.createButton(this.fActionCompareLogs); fButtonCompareLogs.setText(null); fButtonCompareLogs.setMnemonic(KeyEvent.VK_UNDEFINED); } return fButtonCompareLogs; }
From source file:org.eclipse.jubula.rc.swing.driver.RobotAwtImpl.java
/** * {@inheritDoc}// www.ja v a 2 s . c om */ public void type(Object graphicsComponent, char character) throws RobotException { Validate.notNull(graphicsComponent, "The graphic component must not be null"); //$NON-NLS-1$ try { int modifier = 0; Component component = (Component) graphicsComponent; KeyEvent ke = new KeyEvent(component, KeyEvent.KEY_PRESSED, System.currentTimeMillis(), modifier, KeyEvent.VK_UNDEFINED, character); Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(ke); ke = new KeyEvent(component, KeyEvent.KEY_TYPED, System.currentTimeMillis(), modifier, KeyEvent.VK_UNDEFINED, character); Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(ke); IRobotEventConfirmer confirmer = m_interceptor .intercept(new InterceptorOptions(new long[] { AWTEvent.KEY_EVENT_MASK })); ke = new KeyEvent(component, KeyEvent.KEY_RELEASED, System.currentTimeMillis(), modifier, KeyEvent.VK_UNDEFINED, character); Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(ke); confirmer.waitToConfirm(component, new DefaultAwtEventMatcher(KeyEvent.KEY_RELEASED)); } catch (AWTError awte) { log.error(awte); throw new RobotException(awte); } catch (SecurityException se) { log.error(se); throw new RobotException(se); } }