List of usage examples for java.awt BorderLayout PAGE_START
String PAGE_START
To view the source code for java.awt BorderLayout PAGE_START.
Click Source Link
From source file:de.stefanwndelmann.zy1270logger.Test.TestJFreeChart.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor.//from w ww. ja va 2 s . c om */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jButton1 = new javax.swing.JButton(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); jMenu2 = new javax.swing.JMenu(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setMinimumSize(new java.awt.Dimension(800, 600)); setPreferredSize(new java.awt.Dimension(800, 600)); jButton1.setText("Test"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); getContentPane().add(jButton1, java.awt.BorderLayout.PAGE_START); jMenu1.setText("File"); jMenuBar1.add(jMenu1); jMenu2.setText("Edit"); jMenuBar1.add(jMenu2); setJMenuBar(jMenuBar1); pack(); }
From source file:DragColorDemo.java
public DragColorDemo() { super(new BorderLayout()); setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); JColorChooser chooser = new JColorChooser(); chooser.setDragEnabled(true);// ww w . j a v a 2 s .c o m add(chooser, BorderLayout.PAGE_START); //Create the color transfer handler. colorHandler = new ColorTransferHandler(); //Create a matrix of 9 buttons. JPanel buttonPanel = new JPanel(new GridLayout(3, 3)); for (int i = 0; i < 9; i++) { JButton tmp = new JButton("Button " + i); tmp.setTransferHandler(colorHandler); buttonPanel.add(tmp); } add(buttonPanel, BorderLayout.CENTER); //Create a check box. toggleForeground = new JCheckBox("Change the foreground color."); toggleForeground.setSelected(true); toggleForeground.addActionListener(this); JPanel textPanel = new JPanel(new BorderLayout()); textPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); textPanel.add(toggleForeground, BorderLayout.PAGE_START); //Create a label. JLabel label = new JLabel("Change the color of any button or this label by dropping a color."); label.setTransferHandler(colorHandler); label.setOpaque(true); //So the background color can be changed. textPanel.add(label, BorderLayout.PAGE_END); add(textPanel, BorderLayout.PAGE_END); }
From source file:ComboBoxDemo.java
public ComboBoxDemo() { super(new BorderLayout()); String[] petStrings = { "Bird", "Cat", "Dog", "Rabbit", "Pig" }; //Create the combo box, select the item at index 4. //Indices start at 0, so 4 specifies the pig. JComboBox petList = new JComboBox(petStrings); petList.setSelectedIndex(4);//from w ww .ja va 2 s . c o m petList.addActionListener(this); //Set up the picture. picture = new JLabel(); picture.setFont(picture.getFont().deriveFont(Font.ITALIC)); picture.setHorizontalAlignment(JLabel.CENTER); updateLabel(petStrings[petList.getSelectedIndex()]); picture.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); //The preferred size is hard-coded to be the width of the //widest image and the height of the tallest image + the border. //A real program would compute this. picture.setPreferredSize(new Dimension(177, 122 + 10)); //Lay out the demo. add(petList, BorderLayout.PAGE_START); add(picture, BorderLayout.PAGE_END); setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); }
From source file:JWSFileChooserDemo.java
public JWSFileChooserDemo() { super(new BorderLayout()); //Create the log first, because the action listeners //need to refer to it. log = new JTextArea(5, 20); log.setMargin(new Insets(5, 5, 5, 5)); log.setEditable(false);//from ww w . j a v a2 s . co m JScrollPane logScrollPane = new JScrollPane(log); //Create the open button. We use the image from the JLF //Graphics Repository (but we extracted it from the jar). openButton = new JButton("Open a File...", createImageIcon("images/Open16.gif")); openButton.addActionListener(this); //Create the save button. We use the image from the JLF //Graphics Repository (but we extracted it from the jar). saveButton = new JButton("Save a File...", createImageIcon("images/Save16.gif")); //PENDING: removed the Save button action listener //so that people won't overwrite existing files. //See bug 4761577. //saveButton.addActionListener(this); saveButton.setEnabled(false); //For layout purposes, put the buttons in a separate panel JPanel buttonPanel = new JPanel(); buttonPanel.add(openButton); buttonPanel.add(saveButton); //Add the buttons and the log to this panel. add(buttonPanel, BorderLayout.PAGE_START); add(logScrollPane, BorderLayout.CENTER); }
From source file:components.ToolBarDemo2.java
public ToolBarDemo2() { super(new BorderLayout()); //Create the toolbar. JToolBar toolBar = new JToolBar("Still draggable"); addButtons(toolBar);// w w w . j av a 2 s . c o m toolBar.setFloatable(false); toolBar.setRollover(true); //Create the text area used for output. Request //enough space for 5 rows and 30 columns. textArea = new JTextArea(5, 30); textArea.setEditable(false); JScrollPane scrollPane = new JScrollPane(textArea); //Lay out the main panel. setPreferredSize(new Dimension(450, 130)); add(toolBar, BorderLayout.PAGE_START); add(scrollPane, BorderLayout.CENTER); }
From source file:components.ProgressMonitorDemo.java
public ProgressMonitorDemo() { super(new BorderLayout()); //Create the demo's UI. startButton = new JButton("Start"); startButton.setActionCommand("start"); startButton.addActionListener(this); taskOutput = new JTextArea(5, 20); taskOutput.setMargin(new Insets(5, 5, 5, 5)); taskOutput.setEditable(false);//w w w . ja v a 2 s . c o m add(startButton, BorderLayout.PAGE_START); add(new JScrollPane(taskOutput), BorderLayout.CENTER); setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); }
From source file:FocusConceptsDemo.java
public FocusConceptsDemo() { super(new BorderLayout()); b1 = new JButton("JButton"); b2 = new JButton("JButton"); b3 = new JButton("JButton"); b4 = new JButton("JButton"); JPanel buttonPanel = new JPanel(new GridLayout(1, 1)); buttonPanel.add(b1);//from w ww .j av a 2 s . c om buttonPanel.add(b2); buttonPanel.add(b3); buttonPanel.add(b4); text1 = new JTextArea("JTextArea", 15, 40); JPanel textAreaPanel = new JPanel(new BorderLayout()); textAreaPanel.add(text1, BorderLayout.CENTER); t1 = new JTextField("JTextField"); t2 = new JTextField("JTextField"); t3 = new JTextField("JTextField"); t4 = new JTextField("JTextField"); JPanel textFieldPanel = new JPanel(new GridLayout(1, 1)); textFieldPanel.add(t1); textFieldPanel.add(t2); textFieldPanel.add(t3); textFieldPanel.add(t4); add(buttonPanel, BorderLayout.PAGE_START); add(textAreaPanel, BorderLayout.CENTER); add(textFieldPanel, BorderLayout.PAGE_END); setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); }
From source file:org.jax.bham.test.PhenotypeEffectPlotPanel.java
/** * Constructor/*from w ww .j a va 2 s . c om*/ * @param phenotypeDataSource * the phenotype data source * @param strainGroups * the strain groupings */ public PhenotypeEffectPlotPanel(PhenotypeDataSource phenotypeDataSource, Map<String, ? extends Collection<String>> strainGroups) { super(new BorderLayout()); this.chartPanel = new ChartPanel(null, true); this.showIndividualStrainEffectsCheckBox = new JCheckBox("Show Individual Strain Effects", false); this.phenotypeDataSource = phenotypeDataSource; this.phenotypeData = phenotypeDataSource.getPhenotypeData(); this.strainGroups = strainGroups; this.updateChart(); JToolBar toolBar = new JToolBar(); toolBar.add(this.showIndividualStrainEffectsCheckBox); this.showIndividualStrainEffectsCheckBox.addItemListener(new ItemListener() { /** * {@inheritDoc} */ public void itemStateChanged(ItemEvent e) { PhenotypeEffectPlotPanel.this.updateChart(); } }); this.add(toolBar, BorderLayout.PAGE_START); this.add(this.chartPanel, BorderLayout.CENTER); }
From source file:MainClass.EquationSolver.java
public EquationSolver() { panel.setLayout(new BorderLayout()); panel.add(scrollPane);/*from w w w . j a va 2 s. c o m*/ setSize(1200, 700); setResizable(true); setTitle("Equation Solver"); setLocationRelativeTo(null); start.add(eqLbl); start.add(equationComboBox); equationComboBox.addActionListener(this); start.add(methodComboBox); methodComboBox.addActionListener(this); start.add(spLbl); start.add(sp1TextField); start.add(sp2TextField); sp2TextField.setVisible(false); start.add(decLbl); start.add(decTextField); start.add(calculateBtn); calculateBtn.addActionListener(this); add(start, BorderLayout.PAGE_START); center.add(chartPanel); chartPanel.setMouseWheelEnabled(true); center.add(scrollPane); add(center, BorderLayout.CENTER); JScrollPane scrollpane = new JScrollPane(table); scrollpane.setPreferredSize(new Dimension(700, 150)); down.add(scrollpane); add(down, BorderLayout.SOUTH); setVisible(true); }
From source file:streaming.swing.JPanelListeSeries.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor.//from www .j a v a 2s .c om */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jToolBar1 = new javax.swing.JToolBar(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jScrollPane1 = new javax.swing.JScrollPane(); jtSerie = new javax.swing.JTable(); jButton3 = new javax.swing.JButton(); setLayout(new java.awt.BorderLayout()); jToolBar1.setRollover(true); jButton1.setText("Ajouter une srie"); jButton1.setFocusable(false); jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jToolBar1.add(jButton1); jButton2.setText("Supprimer une Srie"); jButton2.setFocusable(false); jButton2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButton2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jToolBar1.add(jButton2); add(jToolBar1, java.awt.BorderLayout.PAGE_START); jtSerie.setModel( new javax.swing.table.DefaultTableModel( new Object[][] { { null, null, null, null }, { null, null, null, null }, { null, null, null, null }, { null, null, null, null } }, new String[] { "Title 1", "Title 2", "Title 3", "Title 4" })); jScrollPane1.setViewportView(jtSerie); add(jScrollPane1, java.awt.BorderLayout.CENTER); jButton3.setText("Accder aux saisons"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); add(jButton3, java.awt.BorderLayout.PAGE_END); }