List of usage examples for java.awt BorderLayout BorderLayout
public BorderLayout()
From source file:SineDraw.java
public Main() { super(new BorderLayout()); add(BorderLayout.CENTER, sines); adjustCycles.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { sines.setCycles(((JSlider) e.getSource()).getValue()); }/*w w w . ja va2 s . co m*/ }); add(BorderLayout.SOUTH, adjustCycles); }
From source file:Controller.Movimientos.ControllerMovimientos.java
public void initMovimientosListeners(Main v) { this.v = v;/*from w ww . java2 s. c om*/ //boton home this.v.btn_home.setActionCommand("btn_home"); this.v.btn_home.addActionListener(this); //boton ventas this.v.pnl_mostrarGrafica.setLayout(new BorderLayout()); this.v.pnl_contenedorInferiorMovimientos.setLayout(new BorderLayout()); this.v.btn_ventasMovi.setActionCommand("btn_ventasMovi"); this.v.btn_ventasMovi.addActionListener(this); this.v.btn_empleMovi.setActionCommand("btn_empleMovi"); this.v.btn_empleMovi.addActionListener(this); this.v.btn_productoMovi.setActionCommand("btn_productoMovi"); this.v.btn_productoMovi.addActionListener(this); this.v.btn_abrirFilechooser.setActionCommand("btn_abrirFilechooser"); this.v.btn_abrirFilechooser.addActionListener(this); this.v.btn_informe.setActionCommand("btn_informe"); this.v.btn_informe.addActionListener(this); mm = new Model_Movimientos(); pdf = new generatePDF(); la = new LabelAccessor(); FileNameExtensionFilter filtro = new FileNameExtensionFilter("Imgenes", "png", "jpg", "gif");//filtramos solo los formatos que queramos de imagen FileNameExtensionFilter filtro1 = new FileNameExtensionFilter("Texto", "pdf", "txt"); this.v.jFileChooser1.setFileFilter(filtro);//le enviamos el filtro this.v.jFileChooser1.setFileFilter(filtro1); this.v.jFileChooser1.setAccessory(new LabelAccessor(this.v.jFileChooser1)); }
From source file:GenderRenderer.java
public TableCellRendererJComboBox() { Container pane = getContentPane(); pane.setLayout(new BorderLayout()); TableValues tv = new TableValues(); table = new JTable(tv); TableColumnModel tcm = table.getColumnModel(); TableColumn tc = tcm.getColumn(TableValues.GENDER); tc.setCellRenderer(new GenderRenderer()); JScrollPane jsp = new JScrollPane(table); pane.add(jsp, BorderLayout.CENTER); }
From source file:FileChooserDemo2.java
public FileChooserDemo2() { super(new BorderLayout()); // Create the log first, because the action listener // needs to refer to it. log = new JTextArea(5, 20); log.setMargin(new Insets(5, 5, 5, 5)); log.setEditable(false);/* www. j a v a2s .c om*/ JScrollPane logScrollPane = new JScrollPane(log); JButton sendButton = new JButton("Attach..."); sendButton.addActionListener(this); add(sendButton, BorderLayout.PAGE_START); add(logScrollPane, BorderLayout.CENTER); }
From source file:DashboardInterface.TensionSpeedDial.java
public TensionSpeedDial(JPanel parentIn) { super(new BorderLayout()); parent = parentIn;//from w w w . j ava 2 s . c om dataset1 = new DefaultValueDataset(0D); dataset2 = new DefaultValueDataset(0D); pipe = MessagePipeline.getInstance(); pipe.attach(this); DialPlot dialplot = new DialPlot(); dialplot.setView(0.0D, 0.0D, 1.0D, 1.0D); dialplot.setDataset(0, dataset1); dialplot.setDataset(1, dataset2); setBackground(Color.WHITE); StandardDialFrame standarddialframe = new StandardDialFrame(); standarddialframe.setBackgroundPaint(Color.lightGray); standarddialframe.setForegroundPaint(Color.darkGray); dialplot.setDialFrame(standarddialframe); DialBackground dialbackground = new DialBackground(Color.LIGHT_GRAY); dialbackground.setGradientPaintTransformer( new StandardGradientPaintTransformer(GradientPaintTransformType.VERTICAL)); dialplot.setBackground(dialbackground); DialTextAnnotation dialtextannotation = new DialTextAnnotation("Tension (lbf)"); dialtextannotation.setFont(new Font("Dialog", 1, 12)); dialtextannotation.setPaint(Color.RED); dialtextannotation.setRadius(0.47999999999999996D); dialplot.addLayer(dialtextannotation); DialTextAnnotation dialtextannotation2 = new DialTextAnnotation("Speed (kts)"); dialtextannotation2.setFont(new Font("Dialog", 1, 12)); dialtextannotation2.setPaint(Color.BLUE); dialtextannotation2.setRadius(0.78999999999999996D); dialplot.addLayer(dialtextannotation2); /*DialValueIndicator dialvalueindicator = new DialValueIndicator(0); dialvalueindicator.setFont(new Font("Dialog", 0, 10)); dialvalueindicator.setOutlinePaint(Color.BLACK); dialvalueindicator.setRadius(0.84999999999999998D); dialvalueindicator.setAngle(-90D); dialplot.addLayer(dialvalueindicator); DialValueIndicator dialvalueindicator1 = new DialValueIndicator(1); dialvalueindicator1.setFont(new Font("Dialog", 0, 10)); dialvalueindicator1.setOutlinePaint(Color.BLACK); dialvalueindicator1.setRadius(0.60999999999999998D); dialvalueindicator1.setAngle(-90D); dialplot.addLayer(dialvalueindicator1);*/ StandardDialScale standarddialscale = new StandardDialScale(0D, 90D, -120D, -300D, 10D, 4); standarddialscale.setTickRadius(0.88D); standarddialscale.setTickLabelOffset(0.14999999999999999D); standarddialscale.setTickLabelFont(new Font("Dialog", 0, 14)); standarddialscale.setTickLabelPaint(Color.BLUE); standarddialscale.setMajorTickPaint(Color.BLUE); standarddialscale.setMinorTickPaint(Color.BLUE); dialplot.addScale(0, standarddialscale); StandardDialScale standarddialscale1 = new StandardDialScale(0.0D, 2500D, -120D, -300D, 500D, 4); standarddialscale1.setTickRadius(0.5D); standarddialscale1.setTickLabelOffset(0.14999999999999999D); standarddialscale1.setTickLabelFont(new Font("Dialog", 0, 10)); standarddialscale1.setTickLabelPaint(Color.RED); standarddialscale1.setMajorTickPaint(Color.RED); standarddialscale1.setMinorTickPaint(Color.RED); dialplot.addScale(1, standarddialscale1); dialplot.mapDatasetToScale(1, 1); org.jfree.chart.plot.dial.DialPointer.Pointer pointer = new org.jfree.chart.plot.dial.DialPointer.Pointer( 0); pointer.setFillPaint(Color.BLUE); dialplot.addPointer(pointer); org.jfree.chart.plot.dial.DialPointer.Pointer pin = new org.jfree.chart.plot.dial.DialPointer.Pointer(1); pin.setRadius(0.55000000000000004D); pin.setFillPaint(Color.RED); dialplot.addPointer(pin); DialCap dialcap = new DialCap(); dialcap.setRadius(0.10000000000000001D); dialplot.setCap(dialcap); Dimension size = parent.getBounds().getSize(); int width = parent.getWidth(); int height = parent.getHeight(); width = 200; JFreeChart jfreechart = new JFreeChart(dialplot); jfreechart.setBackgroundPaint(Color.WHITE); ChartPanel chartpanel = new ChartPanel(jfreechart); chartpanel.setPreferredSize(new Dimension(width, width)); add(chartpanel); }
From source file:GUIManagerQuery.java
/*************************************************************************** * Construct the GUIManagerQuery object, constructing the various components * and laying them out on the screen.// w w w. j a va 2s .c o m **************************************************************************/ public GUIManagerQuery() { super("GUIManagerQuery"); setLayout(new BorderLayout()); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); versionLabel = new Label("JMF v" + Manager.getVersion()); add(versionLabel, "North"); Panel lower = new Panel(); lower.add(new Label("Content/Protocol")); contentsField = new TextField(32); lower.add(contentsField); add(lower, "South"); results = new TextArea(20, 80); results.setEditable(false); add(results, "Center"); Panel controls = new Panel(); controls.setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); hintsButton = new Button("Hints"); gbc.gridx = 0; gbc.gridy = 0; controls.add(hintsButton, gbc); hintsButton.addActionListener(this); playersButton = new Button("Players"); gbc.gridy = 1; controls.add(playersButton, gbc); playersButton.addActionListener(this); processorsButton = new Button("Processors"); gbc.gridy = 2; controls.add(processorsButton, gbc); processorsButton.addActionListener(this); sourcesButton = new Button("DataSources"); gbc.gridy = 3; controls.add(sourcesButton, gbc); sourcesButton.addActionListener(this); add(controls, "East"); }
From source file:com.sec.ose.osi.ui.dialog.about.JPanAbout.java
private void initialize() { this.setLayout(new BorderLayout()); this.add(getJScrollPaneAbout(), BorderLayout.CENTER); }
From source file:Main.java
/** * Sets up the given window content pane by setting its border to provide a * good default spacer, and setting the content pane to the given components. * //from w w w .j av a 2 s . c o m * @param aWindow * the window to setup, cannot be <code>null</code>; * @param aCenterComponent * the component that should appear at the center of the dialog; * @param aButtonPane * the component that should appear at the bottom of the dialog * @param defaultButton * the default button for this dialog; can be null for "none". * @see javax.swing.JRootPane#setDefaultButton(javax.swing.JButton) */ public static void setupWindowContentPane(final Window aWindow, final Component aCenterComponent, final Component aButtonPane, final JButton defaultButton) { final JPanel contentPane = new JPanel(new BorderLayout()); contentPane.setBorder(BorderFactory.createEmptyBorder(DIALOG_PADDING, DIALOG_PADDING, // DIALOG_PADDING, DIALOG_PADDING)); contentPane.add(aCenterComponent, BorderLayout.CENTER); contentPane.add(aButtonPane, BorderLayout.PAGE_END); if (aWindow instanceof JDialog) { ((JDialog) aWindow).setContentPane(contentPane); ((JDialog) aWindow).getRootPane().setDefaultButton(defaultButton); } else if (aWindow instanceof JFrame) { ((JFrame) aWindow).setContentPane(contentPane); ((JFrame) aWindow).getRootPane().setDefaultButton(defaultButton); } aWindow.pack(); }
From source file:CanvasDemo.java
public CanvasDemo() { setLayout(new BorderLayout()); GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration(); Canvas3D canvas = new Canvas3D(config); add("North", new Label("This is the top")); add("Center", canvas); add("South", new Label("This is the bottom")); BranchGroup contents = new BranchGroup(); contents.addChild(new ColorCube(0.3)); SimpleUniverse universe = new SimpleUniverse(canvas); universe.getViewingPlatform().setNominalViewingTransform(); universe.addBranchGraph(contents);/*w w w .j a v a2 s . c o m*/ }
From source file:org.btrg.df.betterologist.swingui.ProjectJobSchedulingPanel.java
public ProjectJobSchedulingPanel() { setLayout(new BorderLayout()); }