List of usage examples for java.awt FlowLayout RIGHT
int RIGHT
To view the source code for java.awt FlowLayout RIGHT.
Click Source Link
From source file:org.openmicroscopy.shoola.agents.metadata.editor.AnnotationTaskPaneUI.java
/** * Creates the toolbar, if needed (see {@link #getToolbarButtons()} *//* w w w.j a v a 2 s. c om*/ private JPanel getToolbar() { JPanel p = new JPanel(); p.setBackground(UIUtilities.BACKGROUND_COLOR); p.setLayout(new FlowLayout(FlowLayout.RIGHT)); List<JButton> buttons = getToolbarButtons(); if (CollectionUtils.isNotEmpty(buttons)) { for (JButton b : buttons) { p.add(b); } } return p; }
From source file:org.uncommons.watchmaker.swing.evolutionmonitor.PopulationFitnessView.java
/** * Creates the GUI controls for toggling graph display options. * @return A component that can be added to the main panel. *//*from w ww.j av a 2 s . co m*/ private JComponent createControls(boolean islands) { JPanel controls = new JPanel(new FlowLayout(FlowLayout.RIGHT)); allDataButton.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent ev) { updateDomainAxisRange(); } }); String text = "Last " + SHOW_FIXED_GENERATIONS + (islands ? " Epochs" : " Generations"); JRadioButton recentDataButton = new JRadioButton(text, true); ButtonGroup buttonGroup = new ButtonGroup(); buttonGroup.add(allDataButton); buttonGroup.add(recentDataButton); controls.add(allDataButton); controls.add(recentDataButton); final JCheckBox meanCheckBox = new JCheckBox("Show Mean", true); meanCheckBox.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent itemEvent) { if (itemEvent.getStateChange() == ItemEvent.SELECTED) { dataSet.addSeries(meanSeries); } else { dataSet.removeSeries(meanSeries); } } }); controls.add(meanCheckBox); invertCheckBox.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent itemEvent) { rangeAxis.setInverted(invertCheckBox.isSelected()); } }); controls.add(invertCheckBox); return controls; }
From source file:org.uncommons.watchmaker.swing.evolutionmonitor.IslandsView.java
/** * Creates the GUI controls for toggling graph display options. * @return A component that can be added to the main panel. *//*from w w w .j a va 2 s. c o m*/ private JComponent createControls() { JPanel controls = new JPanel(new FlowLayout(FlowLayout.RIGHT)); final JCheckBox meanCheckBox = new JCheckBox("Show Mean and Standard Deviation", false); meanCheckBox.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent itemEvent) { chart.setNotify(false); CategoryPlot plot = (CategoryPlot) chart.getPlot(); if (itemEvent.getStateChange() == ItemEvent.SELECTED) { plot.setDataset(1, meanDataSet); plot.setRenderer(1, meanRenderer); } else { plot.setDataset(1, null); plot.setRenderer(1, null); } chart.setNotify(true); } }); controls.add(meanCheckBox); return controls; }
From source file:org.bitbucket.mlopatkin.android.logviewer.ConfigurationDialog.java
private ConfigurationDialog(Frame owner) { super(owner); setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); setModalityType(ModalityType.APPLICATION_MODAL); setTitle("Configuration"); setBounds(100, 100, 400, 122);/*from w w w . j ava 2 s. com*/ getContentPane().setLayout(new BorderLayout()); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel, BorderLayout.CENTER); JLabel lblAdbExecutableLocation = new JLabel("ADB executable location"); textAdbExecutable = new JTextField(Configuration.adb.executable()); lblAdbExecutableLocation.setLabelFor(textAdbExecutable); textAdbExecutable.setColumns(10); JButton btBrowseAdb = new JButton("..."); btBrowseAdb.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { JFileChooser fileChooser = new JFileChooser(); int result = fileChooser.showOpenDialog(ConfigurationDialog.this); if (result == JFileChooser.APPROVE_OPTION) { textAdbExecutable.setText(fileChooser.getSelectedFile().getAbsolutePath()); } } }); GroupLayout gl_contentPanel = new GroupLayout(contentPanel); gl_contentPanel.setHorizontalGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING) .addGroup(gl_contentPanel.createSequentialGroup().addComponent(lblAdbExecutableLocation) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(textAdbExecutable, GroupLayout.DEFAULT_SIZE, 486, Short.MAX_VALUE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(btBrowseAdb, GroupLayout.PREFERRED_SIZE, 33, GroupLayout.PREFERRED_SIZE))); gl_contentPanel.setVerticalGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING) .addGroup(gl_contentPanel.createSequentialGroup() .addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING) .addComponent(lblAdbExecutableLocation) .addGroup(gl_contentPanel.createParallelGroup(Alignment.BASELINE) .addComponent(textAdbExecutable, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(btBrowseAdb))) .addContainerGap(375, Short.MAX_VALUE))); contentPanel.setLayout(gl_contentPanel); { JPanel buttonPane = new JPanel(); buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); getContentPane().add(buttonPane, BorderLayout.SOUTH); { JButton okButton = new JButton(acOk); buttonPane.add(okButton); getRootPane().setDefaultButton(okButton); } { JButton cancelButton = new JButton(acCancel); buttonPane.add(cancelButton); } } }
From source file:tvbrowser.ui.settings.looksSettings.SkinLNFSettings.java
/** * Create the GUI/* ww w.j av a 2 s .c om*/ */ private void createGui() { JPanel content = (JPanel) getContentPane(); content.setLayout(new FormLayout("5dlu, fill:50dlu:grow, 3dlu", "pref, 5dlu, pref, 5dlu, pref, 5dlu, pref, fill:3dlu:grow, pref")); content.setBorder(Borders.DLU4_BORDER); CellConstraints cc = new CellConstraints(); content.add(DefaultComponentFactory.getInstance() .createSeparator(Localizer.getLocalization(Localizer.I18N_HELP)), cc.xyw(1, 1, 3)); content.add( UiUtilities.createHtmlHelpTextArea( mLocalizer.msg("skinLFInfo", "Skin Info", "http://tvbrowser.org/themepacks.php")), cc.xyw(2, 3, 2)); String temp = Settings.propSkinLFThemepack.getString(); temp = StringUtils.substringAfterLast(temp, File.separator); String[] skins = getThemePacks(); mThemePack = new JComboBox(skins); mThemePack.setSelectedItem(temp); content.add(DefaultComponentFactory.getInstance() .createSeparator(mLocalizer.msg("chooseThemepack", "Choose Themepack")), cc.xyw(1, 5, 3)); content.add(mThemePack, cc.xy(2, 7)); JButton ok = new JButton(Localizer.getLocalization(Localizer.I18N_OK)); ok.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { okPressed(); } }); JButton cancel = new JButton(Localizer.getLocalization(Localizer.I18N_CANCEL)); cancel.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { cancelPressed(); } }); ButtonBarBuilder2 bar = new ButtonBarBuilder2(); bar.addButton(new JButton[] { ok, cancel }); JPanel panel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0)); panel.add(bar.getPanel()); content.add(panel, cc.xyw(1, 9, 3)); UiUtilities.registerForClosing(this); setPreferredSize(new Dimension(Sizes.dialogUnitXAsPixel(270, this), Sizes.dialogUnitYAsPixel(180, this))); pack(); }
From source file:org.esa.beam.smos.visat.GridPointBtDataChartToolView.java
@Override protected JComponent createGridPointComponentOptionsComponent() { modeCheckers = new JCheckBox[] { new JCheckBox("X", true), new JCheckBox("Y", true), new JCheckBox("XY", true), }; final JPanel optionsPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 2, 2)); for (JCheckBox modeChecker : modeCheckers) { modeChecker.addActionListener(new ActionListener() { @Override/*from w w w .j av a2 s .c o m*/ public void actionPerformed(ActionEvent e) { updateGridPointBtDataComponent(); } }); optionsPanel.add(modeChecker); } return optionsPanel; }
From source file:captureplugin.drivers.defaultdriver.AdditionalParams.java
/** * Create GUI//w ww . j a v a 2s . com */ private void createGUI() { setTitle(mLocalizer.msg("Additional", "Additional Commands")); UiUtilities.registerForClosing(this); JPanel content = (JPanel) getContentPane(); content.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); content.setLayout(new BorderLayout()); content.add(createListPanel(), BorderLayout.WEST); content.add(createDetailsPanel(), BorderLayout.CENTER); JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT)); JButton ok = new JButton(Localizer.getLocalization(Localizer.I18N_OK)); JButton cancel = new JButton(Localizer.getLocalization(Localizer.I18N_CANCEL)); ok.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { okPressed(); } }); cancel.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { setVisible(false); } }); buttonPanel.add(ok); buttonPanel.add(cancel); content.add(buttonPanel, BorderLayout.SOUTH); mList.setSelectedIndex(0); mList.setCellRenderer(new ParamEntryCellRenderer()); CapturePlugin.getInstance().layoutWindow("additionalParams", this, new Dimension(400, 300)); }
From source file:org.uncommons.watchmaker.swing.evolutionmonitor.JVMView.java
/** * Creates the GUI controls for toggling graph display options. * @return A component that can be added to the main panel. *//*from w w w . java 2 s. c om*/ private JComponent createControls() { JPanel controls = new JPanel(new FlowLayout(FlowLayout.RIGHT)); JButton gcButton = new JButton("Request GC"); gcButton.setToolTipText("Perform garbage collection (the JVM may ignore this request)."); gcButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ev) { memoryBean.gc(); } }); controls.add(gcButton); return controls; }
From source file:gtu._work.ui.StringArrayMakerUI.java
private void initGUI() { try {/*from w w w . jav a2 s . c o m*/ BorderLayout thisLayout = new BorderLayout(); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); getContentPane().setLayout(thisLayout); { jTabbedPane1 = new JTabbedPane(); getContentPane().add(jTabbedPane1, BorderLayout.CENTER); { jPanel1 = new JPanel(); BorderLayout jPanel1Layout = new BorderLayout(); jPanel1.setLayout(jPanel1Layout); jTabbedPane1.addTab("jPanel1", null, jPanel1, null); { jScrollPane2 = new JScrollPane(); jPanel1.add(jScrollPane2, BorderLayout.CENTER); jScrollPane2.setPreferredSize(new java.awt.Dimension(525, 267)); { ListModel jList1Model = new DefaultListModel(); jList1 = new JList(); jScrollPane2.setViewportView(jList1); jList1.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent evt) { JListUtil.newInstance(jList1).defaultJListKeyPressed(evt); } }); jList1.setModel(jList1Model); } } { jButton1 = new JButton(); jPanel1.add(jButton1, BorderLayout.NORTH); jButton1.setText("\u8cbc\u4e0a"); jButton1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jButton1ActionPerformed(evt); } }); } { jPanel3 = new JPanel(); FlowLayout jPanel3Layout = new FlowLayout(); jPanel3Layout.setAlignment(FlowLayout.RIGHT); jPanel1.add(jPanel3, BorderLayout.WEST); jPanel3.setLayout(jPanel3Layout); jPanel3.setPreferredSize(new java.awt.Dimension(50, 291)); { jCheckBox1 = new JCheckBox(); jPanel3.add(jCheckBox1); jCheckBox1.setText("\\n"); } { jCheckBox2 = new JCheckBox(); jPanel3.add(jCheckBox2); jCheckBox2.setText("\\t"); } } } { jPanel2 = new JPanel(); BorderLayout jPanel2Layout = new BorderLayout(); jPanel2.setLayout(jPanel2Layout); jTabbedPane1.addTab("jPanel2", null, jPanel2, null); { jButton2 = new JButton(); jPanel2.add(jButton2, BorderLayout.NORTH); jButton2.setText("\u7522\u751f"); jButton2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jButton2ActionPerformed(evt); } }); } { jScrollPane1 = new JScrollPane(); jPanel2.add(jScrollPane1, BorderLayout.CENTER); jScrollPane1.setPreferredSize(new java.awt.Dimension(525, 291)); { jTextArea1 = new JTextArea(); jScrollPane1.setViewportView(jTextArea1); jTextArea1.setText(""); } } } } pack(); this.setSize(546, 382); } catch (Exception e) { // add your error handling code here e.printStackTrace(); } }
From source file:net.pandoragames.far.ui.swing.dialog.SaveFormDialog.java
private void init(SwingConfig config) { setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); JPanel basePanel = new JPanel(); basePanel.setBorder(BorderFactory.createEmptyBorder(SwingConfig.PADDING * 2, SwingConfig.PADDING, SwingConfig.PADDING, SwingConfig.PADDING)); basePanel.setLayout(new BorderLayout()); registerCloseWindowKeyListener(basePanel); this.add(basePanel); MessageLabel errorLabel = new MessageLabel(); basePanel.add(errorLabel, BorderLayout.NORTH); messageBox = errorLabel;//from ww w . j a va 2s .co m JPanel centerPanel = new JPanel(); centerPanel.setLayout(new BoxLayout(centerPanel, BoxLayout.Y_AXIS)); JLabel titleLabel = new JLabel(localizer.localize("label.name")); titleLabel.setAlignmentX(0); centerPanel.add(titleLabel); textbox = new JTextField(); textbox.setPreferredSize(new Dimension(SwingConfig.COMPONENT_WIDTH, config.getStandardComponentHight())); textbox.setAlignmentX(0); registerEnterKeyListener(textbox, saveAction); centerPanel.add(textbox); basePanel.add(centerPanel, BorderLayout.CENTER); JPanel buttonPannel = new JPanel(); buttonPannel.setLayout(new FlowLayout(FlowLayout.RIGHT)); JButton okButton = new JButton(localizer.localize("button.save")); okButton.addActionListener(saveAction); JButton cancelButton = new JButton(localizer.localize("button.cancel")); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent eve) { SaveFormDialog.this.dispose(); } }); buttonPannel.add(okButton); buttonPannel.add(cancelButton); registerCloseWindowKeyListener(buttonPannel); this.add(buttonPannel, BorderLayout.SOUTH); }