public void setEditable(boolean editable) { this.blocked = !editable; textField.setEditable(editable); textField.setFocusable(editable); if (!editable) { super.setBackground(backgroundColor); } }
txtArea.setPreferredSize(new Dimension((int)(main_frame_size.width * 0.9), (int)(main_frame_size.height * 0.8))); mainFrame.setVisible(true); txtField.setFocusable(true); txtField.requestFocusInWindow(); txtField.setToolTipText("type and then press enter to send");
txtName.setHorizontalAlignment(javax.swing.JTextField.LEFT); txtName.setBorder(javax.swing.BorderFactory.createEtchedBorder()); txtName.setFocusable(false); txtName.setMaximumSize(new java.awt.Dimension(50, 22)); txtName.setOpaque(false); txtType.setHorizontalAlignment(javax.swing.JTextField.LEFT); txtType.setBorder(javax.swing.BorderFactory.createEtchedBorder()); txtType.setFocusable(false); txtType.setOpaque(false); txtType.setRequestFocusEnabled(false); txtStartTime.setHorizontalAlignment(javax.swing.JTextField.CENTER); txtStartTime.setBorder(javax.swing.BorderFactory.createEtchedBorder()); txtStartTime.setFocusable(false); txtStartTime.setOpaque(false); txtStartTime.setRequestFocusEnabled(false); txtEndTime.setHorizontalAlignment(javax.swing.JTextField.CENTER); txtEndTime.setBorder(javax.swing.BorderFactory.createEtchedBorder()); txtEndTime.setFocusable(false); txtEndTime.setOpaque(false); txtEndTime.setRequestFocusEnabled(false); txtTournamentState.setHorizontalAlignment(javax.swing.JTextField.CENTER); txtTournamentState.setBorder(javax.swing.BorderFactory.createEtchedBorder()); txtTournamentState.setFocusable(false); txtTournamentState.setOpaque(false); txtTournamentState.setRequestFocusEnabled(false);
JTextField jTextField1 = new JTextField(); addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jTextField1.setFocusable(false); } });
@Override public void mouseClicked(MouseEvent mouseEvent) { textField.setVisible(true); textMessage.setVisible(false); textField.requestFocus(); textField.setFocusable(true); }
public void becomeFirstResponder(){ textField.setVisible(true); textMessage.setVisible(false); textField.requestFocus(); textField.setFocusable(true); }
resultField.setFocusable(false);
JComboBox myComboBox = new JComboBox(array); myComboBox .setOpaque(false); myComboBox .setEditable(true); JTextField boxField = (JTextField)myComboBox .getEditor().getEditorComponent(); boxField.setBorder(BorderFactory.createEmptyBorder()); boxField.setBackground(new Color(0, 0, 0, 0)); boxField.setFocusable(false);
ipTextfield.setHorizontalAlignment(SwingConstants.CENTER); ipTextfield.setAlignmentX(Component.LEFT_ALIGNMENT); ipTextfield.setFocusable(false); ipTextfield.setEditable(false); add(ipTextfield); uuidTextField.setHorizontalAlignment(SwingConstants.CENTER); uuidTextField.setEditable(false); uuidTextField.setFocusable(false); add(uuidTextField); uuidTextField.setColumns(30);
public GUI(Project project) { this.project = project; frame = new JFrame("SVG to VectorDrawable (" + CommonUtil.loadMetaInf("version", "") + ")"); modulesUtil = new ModulesUtil(project); distDirList.clear(); svgPath.setFocusable(false); setListener(); initModules(); }
tfProject.setFocusable(false);
searchField.setSize(new Dimension(300, 22)); searchField.setPreferredSize(new Dimension(300, 22)); searchField.setFocusable(true); searchField.requestFocus();
textFieldDestination.setText(defaultDir); textFieldDestination.setEditable(false); textFieldDestination.setFocusable(false); textFieldDestination.setCaretPosition(0); panel.add(textFieldDestination);
p2.add(jtfAddField); jtfAddField.addMouseListener(new ContextMenuMouseListener()); jtfAddField.setFocusable(true); p2.setBackground(wc);
private JTextField createResponse(JList list, int width) { JTextField pane = new JTextField(); pane.setFont(getFONT()); pane.setFocusable(true); pane.setEditable(false); pane.setBackground(list.getBackground()); String target = regressionModel.getTargetName(); if (target != null) { pane.setText(target); } else { pane.setText("Hello"); } pane.setCaretPosition(0); LayoutUtils.setAllSizes(pane, new Dimension(width, pane.getPreferredSize().height)); if (target == null) { pane.setText(null); } pane.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { getPredictorsList().clearSelection(); } }); return pane; }
p2.add(jtfDeleteField); jtfDeleteField.addMouseListener(new ContextMenuMouseListener()); jtfDeleteField.setFocusable(true); p2.setBackground(wc);
private JTextField getProjectSiteLabel() { final JTextField result=new JTextField("http://www.taverna.org.uk"); result.setFocusable(true); result.setForeground(Color.BLUE); result.setBackground(BACKGROUND_COLOUR); result.setBorder(null); result.setEditable(false); result.setHorizontalAlignment(JTextField.CENTER); result.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { launchURL(result.getText()); } }); return result; }
public void setValue(E value) { E oldValue = this.value; if (value != null) { nameField.getDocument().removeDocumentListener(nameDocumentListener); this.value = value; nameField.setText(valueToString(value)); nameField.setEditable(false); if (toolTipFocusListener != null) { toolTipFocusListener.setEnabled(false); } nameField.setCaretPosition(0); button.setFocusable(true); nameField.setFocusable(false); button.transferFocus(); updateRemoveLabel(); nameField.getDocument().addDocumentListener(nameDocumentListener); firePropertyChange("value", oldValue, this.value); } else { removeValue(); } paintNameFieldBackground(); }
private void initComponents() { editorButtonAction = new EditorButtonAction(); nameField = new JTextField(); nameField.setEditable(false); nameField.setFocusable(false); if (withRemoveLabel) { removeLabel = new JRemoveLabel(); removeLabel.showErrorIcon(StaticWidgetHelper.getSynaptixWidgetConstantsBundle().noneSelected()); removeLabel.addActionListener(new RemoveActionListener()); } button = new JButton(editorButtonAction); ImageIcon eraseIcon = StaticImage.getImageScale(new ImageIcon(AbstractRemoveAction.class.getResource("iconClearBig.png")), 16); //$NON-NLS-1$ removeAction = new AbstractAction(null, eraseIcon) { private static final long serialVersionUID = 4102703144330237406L; @Override public void actionPerformed(ActionEvent e) { removeValue(); fireChangeListener(); } }; removeAction.putValue(Action.SHORT_DESCRIPTION, StaticWidgetHelper.getSynaptixWidgetConstantsBundle().clear()); }
private void removeValue() { E oldValue = this.value; this.value = null; nameField.setText(null); nameField.setEditable(editable && isEnabled()); nameField.setFocusable(editable && isEnabled()); if (button.hasFocus()) { nameField.grabFocus(); } if (toolTipFocusListener != null) { toolTipFocusListener.setEnabled(editable && isEnabled()); } paintNameFieldBackground(); firePropertyChange("value", oldValue, this.value); updateRemoveLabel(); }