Refine search
private void init() { JTextArea errorArea = new JTextArea(); errorArea.setEditable(false); errorArea.setText(exc.getMessage() + "\n"); getContentPane().setLayout(new BorderLayout()); JPanel messagePanel = new JPanel(new BorderLayout()); messagePanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createRaisedBevelBorder(), BorderFactory .createTitledBorder(BorderFactory.createEtchedBorder(), NLS.nls("COMPILE_ERROR.PANEL.TITLE")))); messagePanel.add(new JScrollPane(errorArea), BorderLayout.CENTER); getContentPane().add(messagePanel, BorderLayout.CENTER); JPanel btnPane = new JPanel(new FlowLayout(FlowLayout.RIGHT)); okBtn = new JButton(NLS.nls("COMPILE_ERROR.OK_BUTTON.CAPTION")); okBtn.addActionListener(this); btnPane.add(okBtn); getRootPane().setDefaultButton(okBtn); getContentPane().add(btnPane, BorderLayout.SOUTH); pack(); setLocationRelativeTo(getParent()); setVisible(true); }
this.setHideOnEscapeButton(); JLabel label = new JLabel("Find What:"); textField = new JTextField(); wrap = new JCheckBox("Wrap"); findButton = new JButton("Find"); findButton.addActionListener(new FindButton()); this.getRootPane().setDefaultButton(findButton); this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(funcF3, "FindNext"); this.getRootPane().getActionMap().put("FindNext", new FindExploreAction(true)); this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(sfuncF3, "FindPrevious"); this.getRootPane().getActionMap().put("FindPrevious", new FindExploreAction(false)); getRootPane().setLayout(layout); layout.setAutoCreateGaps(true); layout.setAutoCreateContainerGaps(true);
protected JRootPane createRootPane() { KeyStroke escapeStroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0); KeyStroke enterStroke = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0); JRootPane rootPane = new JRootPane(); rootPane.registerKeyboardAction(this, escapeStroke, JComponent.WHEN_IN_FOCUSED_WINDOW); rootPane.registerKeyboardAction(this, enterStroke, JComponent.WHEN_IN_FOCUSED_WINDOW); return rootPane; }
private void setHideOnEscapeButton() { Action escapeAction = new AbstractAction() { private static final long serialVersionUID = 5572504000935312338L; @Override public void actionPerformed(ActionEvent e) { FindBox.this.setVisible(false); } }; KeyStroke escapeKeyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false); this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(escapeKeyStroke, "ESCAPE"); this.getRootPane().getActionMap().put("ESCAPE", escapeAction); }
jcb_charset.setEditable(true); JPanel jp = new JPanel(); jp.setLayout(new BorderLayout()); JPanel jp_center = new JPanel(); jp_center.setLayout(new BorderLayout()); JPanel jp_center_west = new JPanel(); jp_center_west.setLayout(new GridLayout(2, 1, 5, 5)); JLabel jl_content_type = new JLabel("Content-type: "); jl_content_type.setLabelFor(jcb_content_type); JLabel jl_char_set = new JLabel("Charset: "); jl_char_set.setLabelFor(jcb_charset); jp_center_west.add(jl_content_type); JPanel jp_south = new JPanel(); jp_south.setLayout(new FlowLayout(FlowLayout.CENTER)); JButton jb_ok = new JButton("Ok"); jb_ok.setMnemonic('o'); getRootPane().setDefaultButton(jb_ok); jb_ok.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) {
labelSource = new javax.swing.JLabel(); comboSets = new javax.swing.JComboBox<>(); fillerMode1 = new javax.swing.Box.Filler(new java.awt.Dimension(5, 0), new java.awt.Dimension(5, 0), new java.awt.Dimension(5, 32767)); buttonSearchSet = new javax.swing.JButton(); buttonOK = new javax.swing.JButton(); getContentPane().setLayout(new java.awt.BorderLayout()); getContentPane().add(panelGlobal, java.awt.BorderLayout.NORTH); panelRedownload.setLayout(new java.awt.BorderLayout()); tabsList.addTab("Custom download", new javax.swing.ImageIcon(getClass().getResource("/buttons/list_panel.png")), tabCustom); // NOI18N getContentPane().add(tabsList, java.awt.BorderLayout.CENTER); getRootPane().setDefaultButton(buttonOK);
setLayout(new BorderLayout(5, 5)); JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.PAGE_AXIS)); mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); add(mainPanel, BorderLayout.CENTER); namePanel.add(new JLabel("Port name: ")); typePanel.add(new JLabel("Type: ")); String[] types = new String[Port.STANDARD_TYPES.size() + 1]; Port.STANDARD_TYPES.toArray(types); customTypePanel.add(new JLabel("Custom Type: ")); final JTextField customTypeField = new JTextField("", 20); customTypeField.setEnabled(false); JButton okButton = new JButton("OK"); getRootPane().setDefaultButton(okButton); KeyStroke escapeStroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0); getRootPane().registerKeyboardAction(new ActionListener() { @Override public void actionPerformed(ActionEvent e) {
panelHeader = new javax.swing.JPanel(); labelMessage = new javax.swing.JLabel(); labelSubMessage = new javax.swing.JLabel(); panelSearch = new javax.swing.JPanel(); labelSearch = new javax.swing.JLabel(); editSearch = new javax.swing.JTextField(); scrollList = new javax.swing.JScrollPane(); listChoices = new javax.swing.JList(); panelCommands = new javax.swing.JPanel(); btOK = new javax.swing.JButton(); btCancel = new javax.swing.JButton(); labelMessage.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); scrollList.setViewportView(listChoices); btOK.setText("Choose"); btOK.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ); getRootPane().setDefaultButton(btOK); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
private void doEncodingPrompt(final String encoding, final String oldEncoding) { final JPanel encodingPanel = new JPanel(); encodingPanel.setLayout(new BoxLayout(encodingPanel, BoxLayout.PAGE_AXIS)); JLabel text = new JLabel("<html>A head finder or tree reader was selected that has the default encoding " + encoding + "; this differs from " + oldEncoding + ", which was being used. If the encoding is changed, all newly loaded" + "treebanks will be read using the new encoding. Choosing an encoding that is not the true encoding of your tree " + "files may cause errors and unexpected behavior.</html>"); text.setAlignmentX(SwingConstants.LEADING); JPanel textPanel = new JPanel(new BorderLayout()); textPanel.setPreferredSize(new Dimension(100,100)); textPanel.add(text); fileFilterDialog.setMessage(encodingPanel); JButton[] options = new JButton[3]; JButton useNewEncoding = new JButton("Use " + encoding); JButton useOldEncoding = new JButton("Use " + oldEncoding); JButton useAnotherEncoding = new JButton("Use encoding..."); alternateEncodingPrompt(encoding); }); dialog.getRootPane().setDefaultButton(useNewEncoding); dialog.pack(); dialog.setLocationRelativeTo(this);
jb_add.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { jb_addAndClose.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { jb_cancel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { getRootPane().setDefaultButton(jb_add); c.setLayout(new BorderLayout()); JPanel jp = new JPanel(new BorderLayout()); JPanel jp_west = new JPanel(new GridLayout(2, 1)); jp_west.add(new JLabel(" Content type: ")); jp_west.add(new JLabel(" Name: ")); jp.add(jp_west, BorderLayout.WEST); c.add(jp, BorderLayout.NORTH); c.add(jsp, BorderLayout.CENTER);
private void setup() { setLayout(new BorderLayout()); JPanel panel = new JPanel(); add(jl, BorderLayout.SOUTH); add(panel, BorderLayout.CENTER); panel.setLayout(new GridLayout(6, 2)); panel.add(new JLabel("Name")); panel.add(jtFields[0]); panel.add(new JLabel("Contact Number")); panel.add(jtFields[1]); panel.add(new JLabel("Address")); panel.add(jtAreas[0]); panel.add(new JLabel("Deposit Number")); panel.add(processButton); clearButton.addActionListener(e -> { for (JTextArea i : jtAreas) { i.setText(""); processButton.addActionListener(e -> { Order order = new Order(jtFields[0].getText(), jtFields[1].getText(), jtAreas[0].getText(), jtFields[2].getText(), jtAreas[1].getText()); rootPane.setDefaultButton(processButton); setVisible(true);
public ClassListItem(Class<? extends T1> clz) { this.clz = clz; }
this.getRootPane().registerKeyboardAction( escapeListener, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), ); JPanel lastLine = new JPanel(); lastLine.setLayout(new BoxLayout(lastLine, BoxLayout.LINE_AXIS)); lastLine.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); this.buttonClose = new JButton("Close"); this.buttonClose.setBorder(BorderFactory.createCompoundBorder( HelperUi.BORDER_FOCUS_GAINED, BorderFactory.createEmptyBorder(2, 20, 2, 20)) ); this.buttonClose.addActionListener(escapeListener); this.setLayout(new BorderLayout()); Container dialogPane = this.getContentPane(); lastLine.add(this.buttonClose); JLabel iconJSQL = new JLabel(new ImageIcon(HelperUi.URL_ICON_96)); dialogPane.add(iconJSQL, BorderLayout.WEST); dialogPane.add(lastLine, BorderLayout.SOUTH); dialogPane.add(this.scrollPane, BorderLayout.CENTER);
getRootPane().registerKeyboardAction( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { p.setLayout(new GridBagLayout()); constraints.anchor = GridBagConstraints.WEST; constraints.insets = new Insets(12, 12, 2, 12); p.add(l, constraints); l.setLabelFor(control); control.addListSelectionListener( new ListSelectionListener() { constraints.weighty = 1.0; constraints.insets = new Insets(0, 12, 11, 11); p.add(new JScrollPane(control), constraints); JPanel bb = new JPanel(); buttonClose = new JButton(Node.getString("Button_close")); buttonClose.setMnemonic(Node.getString("Button_close_Mnemonic").charAt(0)); bb.setLayout(new GridBagLayout()); constraints.fill = GridBagConstraints.HORIZONTAL; constraints.insets = new Insets(0, 0, 5, 11); bb.add(buttonUp, constraints);
JButton cancelButton = new JButton("Cancel"); cancelButton.addActionListener(this); final JButton setButton = new JButton("Select"); setButton.setActionCommand("Select"); setButton.addActionListener(this); getRootPane().setDefaultButton(setButton); JPanel listPane = new JPanel(); listPane.setLayout(new BoxLayout(listPane, BoxLayout.PAGE_AXIS)); JLabel label = new JLabel("Layers"); label.setLabelFor(list); listPane.add(label); listPane.add(Box.createRigidArea(new Dimension(0, 5))); listPane.add(listScroller); contentPane.add(listPane, BorderLayout.CENTER); contentPane.add(buttonPane, BorderLayout.PAGE_END);
final JPanel prefPanel = new JPanel(); prefPanel.setLayout(new GridBagLayout()); JPanel displayOptions = new JPanel(); displayOptions.setLayout(new GridLayout(3,2,0,2)); JLabel historyLabel = new JLabel("Recent matches length: "); final JTextField historySizeField = new JTextField(Integer.toString(Preferences.getHistorySize())); displayOptions.add(historySizeField); JLabel maxMatchesLabel = new JLabel("Max displayed trees: "); final JTextField maxMatchesSizeField = new JTextField(Integer.toString(Preferences.getMaxMatches())); displayOptions.add(maxMatchesSizeField); JButton okay = new JButton("Okay"); JButton cancel = new JButton("Cancel"); prefPane.setOpaque(true); this.setContentPane(prefPane); this.getRootPane().setDefaultButton(okay); okay.addActionListener(new ActionListener() {
public ColorDialog(Frame owner) { super(owner, "Choose Color"); getRootPane().putClientProperty("Window.style", "small"); colorField = new ColorField(); JPanel topPanel = new JPanel(); topPanel.setLayout(new BorderLayout()); topPanel.setMinimumSize(d); topPanel.setPreferredSize(d); topPanel.setMaximumSize(d); rangeBox.setSize(d); JButton cancelButton = new JButton(cancelAction); JButton okButton = new JButton(okAction); bottomPanel.add(Box.createHorizontalStrut(5)); getRootPane().setDefaultButton(okButton); contents.setLayout(new BoxLayout(contents, BoxLayout.Y_AXIS)); contents.add(topPanel); contents.add(hue); contents.add(saturation); contents.add(brightness); getRootPane().registerKeyboardAction(new ActionListener() { public void actionPerformed(ActionEvent e) { setColor(color);
private void initUI() { JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS)); panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); panel.add(makeDeobfuscationGroup()); panel.add(makeDecompilationGroup()); panel.add(makeOtherGroup()); JButton saveBtn = new JButton(NLS.str("preferences.save")); saveBtn.addActionListener(event -> { settings.sync(); if (needReload) { JButton cancelButton = new JButton(NLS.str("preferences.cancel")); cancelButton.addActionListener(event -> { JadxSettingsAdapter.fill(settings, startSettings); String defaults = JadxSettingsAdapter.makeString(JadxSettings.makeDefault()); JadxSettingsAdapter.fill(settings, defaults); getContentPane().removeAll(); initUI(); pack(); contentPane.add(panel, BorderLayout.CENTER); contentPane.add(buttonPane, BorderLayout.PAGE_END); getRootPane().setDefaultButton(saveBtn);
this.getRootPane().registerKeyboardAction( escapeListener, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), ); JPanel lastLine = new JPanel(); lastLine.setLayout(new BoxLayout(lastLine, BoxLayout.LINE_AXIS)); lastLine.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); this.buttonSend.setContentAreaFilled(false); this.buttonSend.setBorder(BorderFactory.createEmptyBorder(4, 8, 4, 8)); this.buttonSend.setBackground(new Color(200, 221, 242)); this.buttonSend.setToolTipText( "<html>" }); this.setLayout(new BorderLayout()); Container containerDialog = this.getContentPane(); lastLine.add(this.buttonSend); containerDialog.add( new LightScrollPane(1, 0, 1, 0, this.textToTranslate[0]), BorderLayout.CENTER
private void initComponents() { JPanel jp = new JPanel(); jp.setLayout(new BorderLayout()); jta_error = new JTextArea(10, 40); jta_error.setEditable(false); JScrollPane jsp = new JScrollPane(jta_error); jp.add(jsp, BorderLayout.CENTER); JPanel jp_south = new JPanel(); jp_south.setLayout(new FlowLayout(FlowLayout.CENTER)); jb_ok = new JButton("Ok"); jb_ok.setMnemonic('o'); getRootPane().setDefaultButton(jb_ok); jb_ok.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { jb_okActionPerformed(event); } }); jp_south.add(jb_ok); jp.add(jp_south, BorderLayout.SOUTH); this.setContentPane(jp); pack(); }