List of usage examples for java.awt FlowLayout LEFT
int LEFT
To view the source code for java.awt FlowLayout LEFT.
Click Source Link
From source file:com.hp.alm.ali.idea.content.settings.SettingsPanel.java
public SettingsPanel(final Project prj, Color bgColor) { this.prj = prj; this.projectConf = prj.getComponent(AliProjectConfiguration.class); previewAndConnection = new JPanel(new GridBagLayout()); previewAndConnection.setOpaque(false); GridBagConstraints c2 = new GridBagConstraints(); c2.gridx = 0;//from w w w . j a v a2 s.c o m c2.gridy = 1; c2.gridwidth = 2; c2.weighty = 1; c2.fill = GridBagConstraints.VERTICAL; JPanel filler = new JPanel(); filler.setOpaque(false); previewAndConnection.add(filler, c2); passwordPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); passwordPanel.setBackground(bgColor); JLabel label = new JLabel("Password"); label.setFont(label.getFont().deriveFont(Font.BOLD)); passwordPanel.add(label); final JPasswordField password = new JPasswordField(24); passwordPanel.add(password); JButton connect = new JButton("Login"); passwordPanel.add(connect); final JLabel message = new JLabel(); passwordPanel.add(message); ActionListener connectionAction = new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { try { checkConnection(projectConf.getLocation(), projectConf.getDomain(), projectConf.getProject(), projectConf.getUsername(), password.getText()); } catch (AuthenticationFailed e) { message.setText(e.getMessage()); return; } projectConf.ALM_PASSWORD = password.getText(); projectConf.fireChanged(); } }; password.addActionListener(connectionAction); connect.addActionListener(connectionAction); restService = prj.getComponent(RestService.class); restService.addServerTypeListener(this); location = createTextPane(bgColor); domain = createTextPane(bgColor); project = createTextPane(bgColor); username = createTextPane(bgColor); final JPanel panel = new JPanel(new BorderLayout()); panel.setBackground(bgColor); panel.setBorder(new EmptyBorder(10, 10, 10, 10)); final JTextPane textPane = new JTextPane(); textPane.setEditorKit(new HTMLEditorKit()); textPane.setText( "<html><body>HP ALM integration can be configured on <a href=\"ide\">IDE</a> and overridden on <a href=\"project\">project</a> level.</body></html>"); textPane.setEditable(false); textPane.addHyperlinkListener(this); textPane.setBackground(bgColor); textPane.setCaret(new NonAdjustingCaret()); panel.add(textPane, BorderLayout.CENTER); JPanel content = new JPanel(new BorderLayout()); content.setBackground(bgColor); content.add(panel, BorderLayout.NORTH); content.add(previewAndConnection, BorderLayout.WEST); preview = new JPanel(new GridBagLayout()) { public Dimension getPreferredSize() { Dimension dim = super.getPreferredSize(); // make enough room for the connection status message dim.width = Math.max(dim.width, 300); return dim; } public Dimension getMinimumSize() { return getPreferredSize(); } }; connectedTo(restService.getServerTypeIfAvailable()); preview.setBackground(bgColor); final GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1; c.gridx = 0; c.gridy = 0; c.gridwidth = 2; c.anchor = GridBagConstraints.WEST; preview.add(location, c); c.gridwidth = 1; c.gridy++; preview.add(domain, c); c.gridy++; preview.add(project, c); c.gridy++; preview.add(username, c); c.gridx++; c.gridy--; c.gridheight = 2; c.weightx = 0; c.anchor = GridBagConstraints.SOUTHEAST; final LinkLabel reload = new LinkLabel("Reload", IconLoader.getIcon("/actions/sync.png")); reload.setListener(new LinkListener() { public void linkSelected(LinkLabel linkLabel, Object o) { projectConf.fireChanged(); } }, null); preview.add(reload, c); JPanel previewNorth = new JPanel(new BorderLayout()); previewNorth.setBackground(bgColor); previewNorth.add(preview, BorderLayout.NORTH); addToGridBagPanel(0, 0, previewAndConnection, previewNorth); setBackground(bgColor); setLayout(new BorderLayout()); add(content, BorderLayout.CENTER); onChanged(); ApplicationManager.getApplication().getComponent(AliConfiguration.class).addListener(this); projectConf.addListener(this); }
From source file:org.diyefi.openlogviewer.propertypanel.PropertiesPane.java
public PropertiesPane(final ResourceBundle labels, final String settingsDirectory) { super(labels.getString(Text.VIEW_MENU_ITEM_SCALE_AND_COLOR_NAME)); this.labels = labels; this.settingsDirectory = settingsDirectory; setDefaultCloseOperation(HIDE_ON_CLOSE); setPreferredSize(new Dimension(350, 500)); setSize(new Dimension(550, 500)); setJMenuBar(createMenuBar());/*from w w w .ja v a2 s .c o m*/ final JPanel propertyPanel = new JPanel(); propertyPanel.setLayout(new BorderLayout()); OpenLogViewer.setupWindowKeyBindings(this); propertyView = new JPanel(); propertyView.setPreferredSize(new Dimension(400, 0)); propertyView.setLayout(new FlowLayout(FlowLayout.LEFT)); final JScrollPane jsp = new JScrollPane(propertyView); propertyPanel.add(jsp, BorderLayout.CENTER); propertyPanel.add(createAcceptPanel(), BorderLayout.SOUTH); add(propertyPanel); }
From source file:org.kuali.test.ui.components.panels.FileTestPanel.java
@Override protected void initComponents() { super.initComponents(); List<String> labels = new ArrayList<String>(); labels.add("File Directory"); labels.add("File Name Pattern"); for (int i = 0; i < Constants.FILE_CHECK_CONDITIONS.length; ++i) { labels.add(""); }/*from w w w . ja v a 2 s . c o m*/ labels.add("Contains Text"); JPanel p = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); p.add(fileDirectory = new JTextField(30)); JButton b = new FileSearchButton(); b.addActionListener(this); p.add(b); List<JComponent> components = new ArrayList<JComponent>(); components.add(p); components.add(fileNamePattern = new JTextField(20)); fileComparisons = new ArrayList<JCheckBox>(); ; for (int i = 0; i < Constants.FILE_CHECK_CONDITIONS.length; ++i) { JCheckBox cb = new JCheckBox(Constants.FILE_CHECK_CONDITIONS[i]); cb.addActionListener(this); components.add(cb); fileComparisons.add(cb); } components.add(containingText = new JTextField(40)); p = new JPanel(new BorderLayout(3, 3)); p.add(UIUtils.buildEntryPanel(labels.toArray(new String[labels.size()]), components.toArray(new JComponent[components.size()])), BorderLayout.NORTH); add(p, BorderLayout.CENTER); }
From source file:View.ReadView.java
public ReadView(ReadController controller, Email obj) throws IOException { this.frame = new JFrame(); this.topPane = new JPanel(); this.topLeftPane = new JPanel(); this.topRightPane = new JPanel(); this.topBottomPane = new JPanel(); this.container = frame.getContentPane(); this.controller = controller; this.bottomPane = new JPanel(); frame.setTitle("Ler Email"); container.setLayout(new BorderLayout(20, 20)); JButton btnSave = new JButton("Salvar no Banco"); btnSave.addActionListener((ActionEvent e) -> { try {//from w w w . j a v a2 s. c o m if (controller.save()) { JOptionPane.showMessageDialog(null, "Mensagem salva com sucesso"); } else { JOptionPane.showMessageDialog(null, "Erro ao salvar mensagem"); } } catch (ClassNotFoundException | SQLException | ParseException ex) { Logger.getLogger(ReadView.class.getName()).log(Level.SEVERE, null, ex); } }); JLabel labelAddress = new JLabel(); labelAddress.setText("Email: " + obj.getAddress()); JLabel labelDate = new JLabel(); labelDate.setText("Data: " + obj.getDate()); JLabel labelSubject = new JLabel(); labelSubject.setText("Assunto: " + obj.getSubject()); JTextArea message = new JTextArea(); message.append("Mensagem aqui..." + obj.getMessage()); messagePane = new JScrollPane(message); topPane.setLayout(new BorderLayout(20, 20)); topPane.add(BorderLayout.WEST, topLeftPane); topPane.add(BorderLayout.EAST, topRightPane); topPane.add(BorderLayout.SOUTH, topBottomPane); topLeftPane.setLayout(new FlowLayout(FlowLayout.LEFT)); topRightPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); topBottomPane.setLayout(new FlowLayout(FlowLayout.LEFT)); topLeftPane.add(labelAddress); topRightPane.add(labelDate); topBottomPane.add(labelSubject); bottomPane.add(btnSave); container.add(BorderLayout.NORTH, topPane); container.add(BorderLayout.CENTER, messagePane); container.add(BorderLayout.SOUTH, bottomPane); frame.pack(); frame.setResizable(false); frame.setLocationRelativeTo(null); frame.setSize(600, 600); Dimension dim = Toolkit.getDefaultToolkit().getScreenSize(); frame.setLocation(dim.width / 2 - frame.getSize().width / 2, dim.height / 2 - frame.getSize().height / 2); frame.setVisible(true); }
From source file:com.eviware.soapui.support.editor.inspectors.auth.ExpirationTimeChooser.java
private JPanel createTimeSelectionPanel() { JPanel timeSelectionPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 3, 0)); boolean enableManualTimeControls = profile.useManualAccessTokenExpirationTime(); timeTextField = createTimeTextField(enableManualTimeControls); timeUnitCombo = createTimeUnitCombo(enableManualTimeControls); timeSelectionPanel.add(timeTextField); timeSelectionPanel.add(timeUnitCombo); return timeSelectionPanel; }
From source file:ErroresPorTraza.TabbedForm.java
private void setChartAceptadosRechazados() { AceptadosRechazadosPie aceptrech = new AceptadosRechazadosPie(); ChartPanel chartpanel1 = aceptrech.getChartPanel("Estado de Trazas", jTable2, suma); jPanelAceptRech.removeAll();/*from w w w .j a va 2 s. c om*/ jPanelAceptRech.setLayout(new FlowLayout(FlowLayout.LEFT)); jPanelAceptRech.add(chartpanel1); this.setLocationRelativeTo(null); }
From source file:com.employee.scheduler.nurserostering.swingui.NurseRosteringPanel.java
private JPanel createHeaderPanel() { JPanel headerPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); headerPanel.add(new JLabel("Planning window start:")); planningWindowStartField = new JTextField(10); planningWindowStartField.setEditable(false); headerPanel.add(planningWindowStartField); advancePlanningWindowStartAction = new AbstractAction("Advance 1 day into the future") { public void actionPerformed(ActionEvent e) { advancePlanningWindowStart(); }// w w w . j a v a2s.c o m }; advancePlanningWindowStartAction.setEnabled(false); headerPanel.add(new JButton(advancePlanningWindowStartAction)); return headerPanel; }
From source file:org.optaplanner.examples.nurserostering.swingui.NurseRosteringPanel.java
private JPanel createHeaderPanel() { JPanel headerPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); headerPanel.add(new JLabel("Planning window start:")); planningWindowStartField = new JTextField(10); planningWindowStartField.setEditable(false); headerPanel.add(planningWindowStartField); advancePlanningWindowStartAction = new AbstractAction("Advance 1 day into the future") { @Override//from w w w . ja v a 2 s. c o m public void actionPerformed(ActionEvent e) { advancePlanningWindowStart(); } }; advancePlanningWindowStartAction.setEnabled(false); headerPanel.add(new JButton(advancePlanningWindowStartAction)); return headerPanel; }
From source file:org.apache.jmeter.visualizers.SearchTreePanel.java
private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final) setLayout(new BorderLayout(10, 10)); searchTF = new JLabeledTextField(JMeterUtils.getResString("search_text_field"), 20); //$NON-NLS-1$ isRegexpCB = new JCheckBox(JMeterUtils.getResString("search_text_chkbox_regexp"), false); //$NON-NLS-1$ isCaseSensitiveCB = new JCheckBox(JMeterUtils.getResString("search_text_chkbox_case"), false); //$NON-NLS-1$ isRegexpCB.setFont(FONT_SMALL);//w w w .j a v a 2s. c o m isCaseSensitiveCB.setFont(FONT_SMALL); searchButton = new JButton(JMeterUtils.getResString("search")); //$NON-NLS-1$ searchButton.addActionListener(this); resetButton = new JButton(JMeterUtils.getResString("reset")); //$NON-NLS-1$ resetButton.addActionListener(this); JPanel searchPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); searchPanel.add(searchTF); searchPanel.add(isCaseSensitiveCB); searchPanel.add(isRegexpCB); searchPanel.add(searchButton); searchPanel.add(resetButton); add(searchPanel); }
From source file:cc.siara.csv_ml_demo.MultiLevelCSVSwingDemo.java
/** * Constructor that adds components to the container, sets layout and opens * with window// w ww . j a v a 2 s . c om * * @param container */ public MultiLevelCSVSwingDemo(Container container) { if (container == null) container = this; if (container instanceof JFrame) { JFrame frame = (JFrame) container; frame.setDefaultCloseOperation(DISPOSE_ON_CLOSE); frame.setLocationByPlatform(true); frame.setTitle("Demonstration of Multi-level CSV parsing (csv_ml)"); } container.setSize(800, 600); container.setLayout(new FlowLayout(FlowLayout.LEFT, 6, 6)); container.add(lblInput); container.add(cbExamples); container.add(lblInputSize); container.add(tfInputSize); container.add(lblDelimiter); container.add(cbDelimiter); container.add(tfDelimiter); container.add(btnAbout); container.add(taInputScroll); container.add(lblOutput); container.add(btnDDLDML); container.add(btnJSON); container.add(btnXML); container.add(btnXPath); container.add(tfXPath); container.add(cbPretty); container.add(taOutputScroll); container.add(lblOutputSize); container.add(tfOutputSize); container.add(btnToCSV); container.add(lblJDBCURL); container.add(tfDBURL); container.add(btnRunDDL); container.add(lblID); container.add(tfID); container.add(btnGetData); JTextField tfID = new JTextField("1", 4); taInput.setBorder(BorderFactory.createLineBorder(getForeground())); taOutput.setBorder(BorderFactory.createLineBorder(getForeground())); setInputText(); cbExamples.addActionListener(this); cbDelimiter.addActionListener(this); btnAbout.addActionListener(this); btnXML.addActionListener(this); btnDDLDML.addActionListener(this); btnJSON.addActionListener(this); btnToCSV.addActionListener(this); btnXPath.addActionListener(this); btnRunDDL.addActionListener(this); btnGetData.addActionListener(this); taInput.addKeyListener(new KeyListener() { public void keyTyped(KeyEvent arg0) { isInputChanged = true; } public void keyReleased(KeyEvent arg0) { } public void keyPressed(KeyEvent arg0) { } }); tfInputSize.setEditable(false); tfOutputSize.setEditable(false); setVisible(true); }