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:org.kuali.test.ui.utils.UIUtils.java
/** * * @param c/*w w w .j a va 2s. c o m*/ * @return */ public static JPanel wrapPanel(JComponent c) { JPanel retval = new JPanel(new FlowLayout(FlowLayout.LEFT)); retval.add(c); return retval; }
From source file:org.tinymediamanager.ui.panels.MediaScraperConfigurationPanel.java
public MediaScraperConfigurationPanel(IMediaProvider mediaProvider) { this.mediaProvider = mediaProvider; setLayout(new BorderLayout()); JPanel panelHead = new JPanel(new FlowLayout(FlowLayout.LEFT, 20, 0)); add(panelHead, BorderLayout.NORTH); JLabel lblScraperOptions = new JLabel(BUNDLE.getString("Settings.scraper.options")); //$NON-NLS-1$ TmmFontHelper.changeFont(lblScraperOptions, 1.2f, Font.BOLD); panelHead.add(lblScraperOptions);//from ww w.ja va2s. c o m configPanel = createConfigPanel(); add(configPanel, BorderLayout.CENTER); // add a listener to determine when to save the settings addAncestorListener(new AncestorListener() { @Override public void ancestorRemoved(AncestorEvent event) { // check if anything has been changed if (dirty) { saveSettings(); } } @Override public void ancestorMoved(AncestorEvent event) { } @Override public void ancestorAdded(AncestorEvent event) { } }); }
From source file:com.stam.batchmove.BatchMoveUtils.java
public static void showFilesFrame(Object[][] data, String[] columnNames, final JFrame callerFrame) { final FilesFrame filesFrame = new FilesFrame(); DefaultTableModel model = new DefaultTableModel(data, columnNames) { private static final long serialVersionUID = 1L; @Override//w w w .jav a 2 s .c o m public Class<?> getColumnClass(int column) { return getValueAt(0, column).getClass(); } @Override public boolean isCellEditable(int row, int column) { return column == 0; } }; DefaultTableCellRenderer renderer = new DefaultTableCellRenderer(); renderer.setHorizontalAlignment(JLabel.CENTER); final JTable table = new JTable(model); for (int i = 1; i < table.getColumnCount(); i++) { table.setDefaultRenderer(table.getColumnClass(i), renderer); } // table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); table.setRowHeight(30); table.getTableHeader().setFont(new Font("Serif", Font.BOLD, 14)); table.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 14)); table.setRowSelectionAllowed(false); table.getColumnModel().getColumn(0).setMaxWidth(35); table.getColumnModel().getColumn(1).setPreferredWidth(350); table.getColumnModel().getColumn(2).setPreferredWidth(90); table.getColumnModel().getColumn(2).setMaxWidth(140); table.getColumnModel().getColumn(3).setMaxWidth(90); JPanel tblPanel = new JPanel(); JPanel btnPanel = new JPanel(); tblPanel.setLayout(new BorderLayout()); if (table.getRowCount() > 15) { JScrollPane scrollPane = new JScrollPane(table); tblPanel.add(scrollPane, BorderLayout.CENTER); } else { tblPanel.add(table.getTableHeader(), BorderLayout.NORTH); tblPanel.add(table, BorderLayout.CENTER); } btnPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); filesFrame.setMinimumSize(new Dimension(800, 600)); filesFrame.setLayout(new BorderLayout()); filesFrame.add(tblPanel, BorderLayout.NORTH); filesFrame.add(btnPanel, BorderLayout.SOUTH); final JLabel resultsLabel = new JLabel(); JButton cancelBtn = new JButton("Cancel"); cancelBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { filesFrame.setVisible(false); callerFrame.setVisible(true); } }); JButton moveBtn = new JButton("Copy"); moveBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { JFileChooser fileChooser = new JFileChooser(); fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); fileChooser.setDialogTitle("Choose target directory"); int selVal = fileChooser.showOpenDialog(null); if (selVal == JFileChooser.APPROVE_OPTION) { File selection = fileChooser.getSelectedFile(); String targetPath = selection.getAbsolutePath(); DefaultTableModel dtm = (DefaultTableModel) table.getModel(); int nRow = dtm.getRowCount(); int copied = 0; for (int i = 0; i < nRow; i++) { Boolean selected = (Boolean) dtm.getValueAt(i, 0); String filePath = dtm.getValueAt(i, 1).toString(); if (selected) { try { FileUtils.copyFileToDirectory(new File(filePath), new File(targetPath)); dtm.setValueAt("Copied", i, 3); copied++; } catch (Exception ex) { Logger.getLogger(SelectionFrame.class.getName()).log(Level.SEVERE, null, ex); dtm.setValueAt("Failed", i, 3); } } } resultsLabel.setText(copied + " files copied. Finished!"); } } }); btnPanel.add(cancelBtn); btnPanel.add(moveBtn); btnPanel.add(resultsLabel); filesFrame.revalidate(); filesFrame.setVisible(true); callerFrame.setVisible(false); }
From source file:ErroresPorTraza.TabbedForm.java
private void setChartCantidadErrores() { TiposErrorChart chartError = new TiposErrorChart(); ChartPanel chartpanel1 = chartError.getChartPanel("Cantidad de errores", jTable1); jPanelChartError.removeAll();// ww w . ja v a2 s. co m jPanelChartError.setLayout(new FlowLayout(FlowLayout.LEFT)); jPanelChartError.add(chartpanel1); this.setLocationRelativeTo(null); int totales = chartError.getSumaCantidades(); setChartPorcentaje(totales); tablaresult = chartError.getResultadosExcell(); }
From source file:org.openconcerto.erp.graph.GraphFamilleArticlePanel.java
public GraphFamilleArticlePanel(Date d1, Date d2) { this.d1 = d1; this.d2 = d2; List<String> labels = new ArrayList<String>(); List<Number> values = new ArrayList<Number>(); BigDecimal total = updateDataset(labels, values); PieChart chart = new PieChart(); chart.setDimension(new Dimension(800, 360)); chart.setData(values);//from w ww . j ava 2 s. c o m for (String label : labels) { chart.addLabel(new Label(label)); } ChartPanel p = new ChartPanel(chart); this.setLayout(new GridBagLayout()); final GridBagConstraints c = new DefaultGridBagConstraints(); c.insets = new Insets(4, 6, 4, 4); p.setOpaque(false); this.setBackground(Color.WHITE); this.add(p, c); final JPanel p1 = new JPanel(); p1.setOpaque(false); p1.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5)); SimpleDateFormat format = new SimpleDateFormat("dd/MM/yy"); p1.add(new JLabelBold("Rpartition du chiffre d'affaire du " + format.format(d1) + " au " + format.format(d2) + " pour un total de " + decFormat.format(total.setScale(2, RoundingMode.HALF_UP).doubleValue()) + "")); c.gridy++; c.weighty = 1; c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.NORTHWEST; this.add(p1, c); }
From source file:com.emental.mindraider.ui.dialogs.AddLinkToConceptJDialog.java
/** * Constructor.//from w ww . jav a 2s .co m */ public AddLinkToConceptJDialog() { super("Add Link To Note"); JPanel framePanel = new JPanel(); framePanel.setLayout(new GridLayout(3, 1)); JPanel p = new JPanel(); p.setLayout(new FlowLayout(FlowLayout.RIGHT)); p.add(new JLabel(" Predicate: ")); predicateNs = new JTextField(38); predicateNs.setText("http://" + MindRaider.profile.getHostname() + "/e-mentality/conceptLink/custom#"); predicateNs.selectAll(); p.add(predicateNs); p.add(new JLabel("#")); predicateLocalName = new JTextField(15); p.add(predicateLocalName); framePanel.add(p); p = new JPanel(); p.setLayout(new FlowLayout(FlowLayout.LEFT)); p.add(new JLabel(" Note: ")); objectNs = new JTextField(38); objectNs.setText(""); objectNs.selectAll(); p.add(objectNs); findConceptButton = new JButton("Find Note"); findConceptButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { OpenNoteJDialog.NoteToOpen conceptToOpen = new OpenNoteJDialog.NoteToOpen(); new OpenNoteJDialog("OpenNoteJDialog.titleLink", "OpenNoteJDialog.selectConceptToLink", "OpenNoteJDialog.link", null, conceptToOpen); if (conceptToOpen.conceptLabel != null) { objectNs.setText(conceptToOpen.conceptUri); } } }); p.add(findConceptButton); framePanel.add(p); p = new JPanel(); p.setLayout(new FlowLayout(FlowLayout.CENTER)); JButton addButton = new JButton("Add"); p.add(addButton); addButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { createTriplet(); } }); JButton cancelButton = new JButton("Cancel"); p.add(cancelButton); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { AddLinkToConceptJDialog.this.dispose(); } }); framePanel.add(p); getContentPane().add(framePanel, BorderLayout.CENTER); // show pack(); Gfx.centerAndShowWindow(this); }
From source file:net.chunkyhosting.Roe.computer.CHGManager.gui.dialogs.DownloadNotice.java
public DownloadNotice(HashMap<JSONObject, URL> downloads) { this.setDownloads(downloads); JPanel basic = new JPanel(); basic.setLayout(new BoxLayout(basic, BoxLayout.Y_AXIS)); add(basic);/*from w w w. j a v a 2 s . c o m*/ JPanel topPanel = new JPanel(new BorderLayout(0, 0)); topPanel.setMaximumSize(new Dimension(450, 0)); JLabel hint = new JLabel("CHGManager Download Manager"); hint.setBorder(BorderFactory.createEmptyBorder(0, 25, 0, 0)); topPanel.add(hint); JSeparator separator = new JSeparator(); separator.setForeground(Color.gray); topPanel.add(separator, BorderLayout.SOUTH); basic.add(topPanel); JPanel textPanel = new JPanel(new BorderLayout()); textPanel.setBorder(BorderFactory.createEmptyBorder(15, 25, 15, 25)); this.setTextPanel(new JTextPane()); this.getTextPanel().setContentType("text/html"); String text = "<p><b>Some files are missing from your CHGManager install. Don't worry. We're trying to download them. Please don't close this panel!</b></p>"; this.getText().add(text); this.getTextPanel().setText(text); this.getTextPanel().setEditable(false); JScrollPane sp = new JScrollPane(); sp.setSize(this.getTextPanel().getSize()); basic.add(sp); //basic.add(textPanel); JPanel boxPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 20, 0)); basic.add(boxPanel); JPanel bottom = new JPanel(new FlowLayout(FlowLayout.RIGHT)); JButton close = new JButton("Close"); bottom.add(close); basic.add(bottom); bottom.setMaximumSize(new Dimension(450, 0)); this.setTitle("CHGManager Download Manager"); this.setResizable(false); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); this.setLocationRelativeTo(null); this.setVisible(true); try { Thread.sleep(2000); } catch (InterruptedException e) { } this.startDownload(); }
From source file:be.vds.jtbdive.client.view.core.stats.StatPanel.java
private Component createHeader() { statWizardButton = new JButton(new AbstractAction() { private static final long serialVersionUID = -5345284505247399133L; @Override/*from www .j a va 2 s . c o m*/ public void actionPerformed(ActionEvent e) { StatWizard wizard = new StatWizard(logBookManagerFacade); statQueryObject = wizard.launchWizard(); displayStatQueryObjectResult(); } }); statWizardButton.setIcon(UIAgent.getInstance().getIcon(UIAgent.ICON_STATISTICS_16)); statWizardButton.setEnabled(false); JPanel p = new JPanel(new FlowLayout(FlowLayout.LEFT)); p.setOpaque(false); p.add(statWizardButton); return p; }
From source file:ErroresPorTraza.TabbedForm.java
private void setChartCantidadErroresPorMil() { ErroresPorMilChart chartErrores = new ErroresPorMilChart(); ChartPanel chartpanel1 = chartErrores.getChartPanel("Errores por mil", jTable3); jPanelMill.removeAll();//from ww w .jav a 2 s .c o m jPanelMill.setLayout(new FlowLayout(FlowLayout.LEFT)); jPanelMill.add(chartpanel1); this.setLocationRelativeTo(null); }
From source file:org.pmedv.jake.app.PlayerView.java
private JPanel createTopPanel() { JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); buttonPanel.setBackground(Colors.LIGHT_GRAY); ImageIcon playIcon = resources.getIcon("icon.play"); ImageIcon stopIcon = resources.getIcon("icon.stop"); ImageIcon nextIcon = resources.getIcon("icon.next"); ImageIcon prevIcon = resources.getIcon("icon.last"); prevButton = new CmdJButton(prevIcon, "Plays the previous song", null); nextButton = new CmdJButton(nextIcon, "Plays the next song", null); startButton = new CmdJButton(playIcon, "Starts playing", null); stopButton = new CmdJButton(stopIcon, "Stops playing", null); buttonPanel.add(startButton);/*from www.j a v a 2s .c o m*/ buttonPanel.add(stopButton); buttonPanel.add(prevButton); buttonPanel.add(nextButton); buttonPanel.setBorder(new CompoundBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0), BorderFactory.createLineBorder(Color.LIGHT_GRAY))); timeField = new JTextField(5); timeField.setEditable(false); timeField.setBackground(Colors.SOFT_BLUE_ICE); titleField = new JMarqueeTextField(30); titleField.setEditable(false); titleField.setBackground(Colors.SOFT_BLUE_ICE); buttonPanel.add(timeField); buttonPanel.add(titleField); randomBox = new JCheckBox("R"); buttonPanel.add(randomBox); return buttonPanel; }