Refine search
public void addRow(String label, String tooltip, JComponent comp) { c.gridy = row++; JLabel jLabel = new JLabel(label); jLabel.setLabelFor(comp); jLabel.setHorizontalAlignment(SwingConstants.LEFT); c.gridx = 0; c.gridwidth = 1; c.anchor = GridBagConstraints.LINE_START; c.weightx = 0.8; c.fill = GridBagConstraints.NONE; add(jLabel, c); c.gridx = 1; c.gridwidth = GridBagConstraints.REMAINDER; c.anchor = GridBagConstraints.CENTER; c.weightx = 0.2; c.fill = GridBagConstraints.HORIZONTAL; if (tooltip != null) { jLabel.setToolTipText(tooltip); comp.setToolTipText(tooltip); } add(comp, c); comp.addPropertyChangeListener("enabled", evt -> jLabel.setEnabled((boolean) evt.getNewValue())); }
protected JPanel getFontFamilyPanel() { if (fontNamePanel == null) { fontNamePanel = new JPanel(); fontNamePanel.setLayout(new BorderLayout()); fontNamePanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); fontNamePanel.setPreferredSize(new Dimension(180, 130)); JScrollPane scrollPane = new JScrollPane(getFontFamilyList()); scrollPane.getVerticalScrollBar().setFocusable(false); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); JPanel p = new JPanel(); p.setLayout(new BorderLayout()); p.add(getFontFamilyTextField(), BorderLayout.NORTH); p.add(scrollPane, BorderLayout.CENTER); JLabel label = new JLabel(("Font Name")); label.setHorizontalAlignment(JLabel.LEFT); label.setHorizontalTextPosition(JLabel.LEFT); label.setLabelFor(getFontFamilyTextField()); label.setDisplayedMnemonic('F'); fontNamePanel.add(label, BorderLayout.NORTH); fontNamePanel.add(p, BorderLayout.CENTER); } return fontNamePanel; }
String[] labels = {"Name: ", "Fax: ", "Email: ", "Address: "}; int numPairs = labels.length; //Create and populate the panel. JPanel p = new JPanel(new SpringLayout()); for (int i = 0; i < numPairs; i++) { JLabel l = new JLabel(labels[i], JLabel.TRAILING); p.add(l); JTextField textField = new JTextField(10); l.setLabelFor(textField); p.add(textField); } //Lay out the panel. SpringUtilities.makeCompactGrid(p, numPairs, 2, //rows, cols 6, 6, //initX, initY 6, 6); //xPad, yPad
jLabel1 = new javax.swing.JLabel(); cbPlayerType = new javax.swing.JComboBox(); lblPlayerNum = new javax.swing.JLabel(); pnlPlayerName = new javax.swing.JPanel(); txtPlayerName = new javax.swing.JTextField(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); spnLevel = new javax.swing.JSpinner(); jLabel1.setLabelFor(cbPlayerType); jLabel1.setText("Type:");
final JLabel lbl; if (popupMenu != null) { lbl = new JLabel(org.openide.util.ImageUtilities.loadImageIcon(ICON_FIND_WITH_MENU, false)); lbl.addMouseListener(new MouseAdapter() { @Override lbl = new JLabel(org.openide.util.ImageUtilities.loadImageIcon(ICON_FIND, false)); searchPanel.add(lbl); searchPanel.add(searchTextField); searchPanel.setBackground(component.getBackground()); lbl.setLabelFor(searchTextField); searchTextField.setColumns(10); searchTextField.setMaximumSize(searchTextField.getPreferredSize());
public static JPanel createTitledPanel(JLabel label, char mnemonic, JComponent component) { JPanel panel = new JPanel(new BorderLayout(2, 2)); panel.add(label, BorderLayout.BEFORE_FIRST_LINE); label.setDisplayedMnemonic(mnemonic); if (component instanceof JScrollPane) { label.setLabelFor(((JScrollPane) component).getViewport().getView()); } else { label.setLabelFor(component); } panel.add(component, BorderLayout.CENTER); return panel; }
protected JPanel getFontStylePanel() { if (fontStylePanel == null) { fontStylePanel = new JPanel(); fontStylePanel.setLayout(new BorderLayout()); fontStylePanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); fontStylePanel.setPreferredSize(new Dimension(140, 130)); JScrollPane scrollPane = new JScrollPane(getFontStyleList()); scrollPane.getVerticalScrollBar().setFocusable(false); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); JPanel p = new JPanel(); p.setLayout(new BorderLayout()); p.add(getFontStyleTextField(), BorderLayout.NORTH); p.add(scrollPane, BorderLayout.CENTER); JLabel label = new JLabel(("Font Style")); label.setHorizontalAlignment(JLabel.LEFT); label.setHorizontalTextPosition(JLabel.LEFT); label.setLabelFor(getFontStyleTextField()); label.setDisplayedMnemonic('Y'); fontStylePanel.add(label, BorderLayout.NORTH); fontStylePanel.add(p, BorderLayout.CENTER); } return fontStylePanel; }
JPanel panel = new JPanel(); panel.setOpaque (false); JLabel textLabel = new JLabel(); Mnemonics.setLocalizedText(textLabel, text); textLabel.setLabelFor(textField);
private void addField(JPanel p, GridBagConstraints c, int y, String lbl, JComponent field) { c.gridy = y; JLabel l = new JLabel(lbl, SwingConstants.TRAILING); l.setLabelFor(field); c.anchor = GridBagConstraints.LINE_END; c.gridx = 0; p.add(l, c); c.anchor = GridBagConstraints.LINE_START; c.gridx = 1; p.add(field, c); } private JPanel createPropertiesPane() {
public ProgressPanel(final MainWindow mainWindow, boolean showCancelButton) { progressLabel = new JLabel(); progressBar = new JProgressBar(0, 100); progressBar.setIndeterminate(true); progressBar.setStringPainted(false); progressLabel.setLabelFor(progressBar); setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); setVisible(false); add(progressLabel); add(progressBar); if (showCancelButton) { JButton cancelButton = new JButton(ICON_CANCEL); cancelButton.setPreferredSize(new Dimension(ICON_CANCEL.getIconWidth(), ICON_CANCEL.getIconHeight())); cancelButton.setToolTipText("Cancel background jobs"); cancelButton.setBorderPainted(false); cancelButton.setFocusPainted(false); cancelButton.setContentAreaFilled(false); cancelButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { mainWindow.cancelBackgroundJobs(); } }); add(cancelButton); } }
private void addSizeLabel() { sizeLabel.setLabelFor(sizePane); sizeLabel.setDisplayedMnemonic(ResourceBundleUtil.getFirstChar(resourceBundle, "font.size.mnemonic")); sizeLabel.setText(resourceBundle.getString("font.size")); GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.anchor = GridBagConstraints.LINE_START; gridBagConstraints.insets = new Insets(0, 0, 5, 0); fontPanel.add(sizeLabel, gridBagConstraints); }
protected JPanel getFontSizePanel() { if (fontSizePanel == null) { fontSizePanel = new JPanel(); fontSizePanel.setLayout(new BorderLayout()); fontSizePanel.setPreferredSize(new Dimension(70, 130)); fontSizePanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); JScrollPane scrollPane = new JScrollPane(getFontSizeList()); scrollPane.getVerticalScrollBar().setFocusable(false); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); JPanel p = new JPanel(); p.setLayout(new BorderLayout()); p.add(getFontSizeTextField(), BorderLayout.NORTH); p.add(scrollPane, BorderLayout.CENTER); JLabel label = new JLabel(("Font Size")); label.setHorizontalAlignment(JLabel.LEFT); label.setHorizontalTextPosition(JLabel.LEFT); label.setLabelFor(getFontSizeTextField()); label.setDisplayedMnemonic('S'); fontSizePanel.add(label, BorderLayout.NORTH); fontSizePanel.add(p, BorderLayout.CENTER); } return fontSizePanel; }
jLabel6.setText("Step 2:"); lblAuthToken.setLabelFor(txtAuthToken); lblAuthToken.setText("Auth token:"); lblPassword.setLabelFor(txtPassword); lblPassword.setText("New password:"); lblPasswordConfirmation.setLabelFor(txtPasswordConfirmation); lblPasswordConfirmation.setText("New password:"); lblPasswordConfirmationReasoning.setLabelFor(txtPasswordConfirmation); lblPasswordConfirmationReasoning.setText("(confirmation)"); jLabel5.setText("Step 1:"); lblEmail.setLabelFor(txtEmail); lblEmail.setText("Email:"); btnCancel.addActionListener(evt -> btnCancelActionPerformed(evt)); lblServer.setLabelFor(txtServer); lblServer.setText("Server:"); lblPort.setLabelFor(txtPort); lblPort.setText("Port:");
protected void addField(JPanel panel, String labelString, JTextField field) { JLabel label = new JLabel(labelString, JLabel.TRAILING); label.setPreferredSize(new Dimension(0, 0)); field.setPreferredSize(new Dimension(0, 0)); panel.add(label); label.setLabelFor(field); field.addFocusListener(this); // FIXME: Not i18n compatible to use label as identifier (like the rest // of Taverna) panel.add(field); }
JLabel filenameLabel = new JLabel("Filename:"); filenameLabel.setLabelFor(filename);
private void addStyleLabel() { styleLabel.setLabelFor(stylePane); styleLabel.setDisplayedMnemonic(ResourceBundleUtil.getFirstChar(resourceBundle, "font.style.mnemonic")); styleLabel.setText(resourceBundle.getString("font.style")); GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.anchor = GridBagConstraints.LINE_START; gridBagConstraints.insets = new Insets(0, 0, 5, DEFAULT_SPACE); fontPanel.add(styleLabel, gridBagConstraints); }
textPane.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15)); JPanel controlPane = new JPanel(); controlPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); final JComboBox<Level> cb = new JComboBox<>(LEVEL_ITEMS); registerLogListener(); }); JLabel levelLabel = new JLabel(NLS.str("log_viewer.log_level")); levelLabel.setLabelFor(cb); controlPane.add(levelLabel); controlPane.add(cb);
pnlProxyAuth = new javax.swing.JPanel(); lblServer.setLabelFor(txtServer); lblServer.setText("Server:"); lblPort.setLabelFor(txtPort); lblPort.setText("Port:"); lblProxyType.setLabelFor(cbProxyType); lblProxyType.setText("Proxy:"); lblProxyServer.setLabelFor(txtProxyServer); lblProxyServer.setText("Server:"); lblProxyPort.setLabelFor(txtProxyPort); lblProxyPort.setText("Port:"); ); lblProxyUserName.setLabelFor(txtProxyUserName); lblProxyUserName.setText("User Name:"); ); lblPassword.setLabelFor(txtPassword); lblPassword.setText("Password:");
private void addLabel(String string, char c, JComponent jComponent) { JLabel label = new JLabel(string); p.add(label); label.setDisplayedMnemonic(c); label.setLabelFor(jComponent); p.add(jComponent, "growx, wrap"); }
JLabel jl_url = new JLabel("URL: "); jl_url.setLabelFor(jcb_url); jl_url.setDisplayedMnemonic('u'); rest_ui.getFrame().getRootPane().setDefaultButton(jb_request);