List of usage examples for java.awt BorderLayout SOUTH
String SOUTH
To view the source code for java.awt BorderLayout SOUTH.
Click Source Link
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()); }//from w w w .j av a 2 s . c o m }); add(BorderLayout.SOUTH, adjustCycles); }
From source file:ec.display.chart.StatisticsChartPaneTab.java
/** * This method initializes this/*from w w w.j av a 2s .co m*/ * * @return void */ private void initialize() { this.setLayout(new BorderLayout()); this.setSize(300, 200); this.add(getJPanel(), java.awt.BorderLayout.SOUTH); }
From source file:SimpleBufferedImageDemo.java
public SimpleBufferedImageDemo() { super();/*from w ww . j ava2 s. c om*/ Container container = getContentPane(); canvas = new DisplayCanvas(); container.add(canvas); JPanel panel = new JPanel(); panel.setLayout(new GridLayout(2, 2)); panel.setBorder(new TitledBorder("Select an Option and Display Image...")); buffButton = new JRadioButton("Buffered"); buffButton.addActionListener(new ButtonListener()); nonBuffButton = new JRadioButton("Non-Buffered", true); nonBuffButton.addActionListener(new ButtonListener()); ButtonGroup group = new ButtonGroup(); group.add(buffButton); group.add(nonBuffButton); displayButton = new JButton("Display"); displayButton.addActionListener(new ButtonListener()); clearButton = new JButton("Clear"); clearButton.addActionListener(new ButtonListener()); panel.add(nonBuffButton); panel.add(buffButton); panel.add(displayButton); panel.add(clearButton); container.add(BorderLayout.SOUTH, panel); addWindowListener(new WindowEventHandler()); pack(); setVisible(true); }
From source file:Main.java
public TColor() { sliderR = getSlider(0, 255, 0, 50, 5); sliderG = getSlider(0, 255, 0, 50, 5); sliderB = getSlider(0, 255, 0, 50, 5); sliderH = getSlider(0, 10, 0, 5, 1); sliderS = getSlider(0, 10, 0, 5, 1); sliderBr = getSlider(0, 10, 0, 5, 1); sliderAlpha = getSlider(0, 255, 255, 50, 5); JPanel panel = new JPanel(); panel.setLayout(new GridLayout(6, 2, 15, 0)); panel.add(new JLabel("R-G-B Sliders (0 - 255)")); panel.add(new JLabel("H-S-B Sliders (ex-1)")); panel.add(sliderR);/*w w w.j a v a2 s .c o m*/ panel.add(sliderH); panel.add(sliderG); panel.add(sliderS); panel.add(sliderB); panel.add(sliderBr); panel.add(new JLabel("Alpha Adjustment (0 - 255): ", JLabel.RIGHT)); panel.add(sliderAlpha); panel.add(new JLabel("RGB Value: ", JLabel.RIGHT)); rgbValue.setBackground(Color.white); rgbValue.setForeground(Color.black); rgbValue.setOpaque(true); panel.add(rgbValue); add(panel, BorderLayout.SOUTH); add(canvas); }
From source file:EditorDropTarget4.java
public static void main(String[] args) { try {//w w w . j a va 2s . co m UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); } catch (Exception evt) { } final JFrame f = new JFrame("JEditor Pane Drop Target Example 4"); // Create an editor with autoscrolling support final JEditorPane pane = new AutoScrollingEditorPane(); // Add a drop target to the JEditorPane EditorDropTarget4 target = new EditorDropTarget4(pane); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent evt) { System.exit(0); } }); JPanel panel = new JPanel(); final JCheckBox editable = new JCheckBox("Editable"); editable.setSelected(true); panel.add(editable); editable.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { pane.setEditable(editable.isSelected()); } }); final JCheckBox enabled = new JCheckBox("Enabled"); enabled.setSelected(true); panel.add(enabled); enabled.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { pane.setEnabled(enabled.isSelected()); } }); f.getContentPane().add(new JScrollPane(pane), BorderLayout.CENTER); f.getContentPane().add(panel, BorderLayout.SOUTH); f.setSize(500, 400); f.setVisible(true); }
From source file:org.onesun.sdi.swing.app.views.dialogs.ChartDialog.java
public ChartDialog(Frame parent, JFreeChart moodChart, JFreeChart sentimentChart) { super(parent, true); this.parent = parent; this.setLayout(new BorderLayout(5, 5)); setTitle("Chart"); setSize(350, 225);/*from w w w .j av a 2 s. c o m*/ setResizable(false); setVisible(false); JPanel chartPanel = new JPanel(new GridLayout(1, 2)); chartPanel.add(new ChartPanel(moodChart)); chartPanel.add(new ChartPanel(sentimentChart)); JPanel panel = new JPanel(new FlowLayout(FlowLayout.CENTER, 5, 15)); panel.add(okButton); this.add(chartPanel, BorderLayout.CENTER); this.add(panel, BorderLayout.SOUTH); UserActionListener userActionListener = new UserActionListener(); okButton.addActionListener(userActionListener); }
From source file:EventTracerTest.java
public EventTracerFrame() { setTitle("EventTracerTest"); setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT); // add a slider and a button add(new JSlider(), BorderLayout.NORTH); add(new JButton("Test"), BorderLayout.SOUTH); // trap all events of components inside the frame EventTracer tracer = new EventTracer(); tracer.add(this); }
From source file:MyStatsPanel.java
public MyStatsPanel(AdminGUI adminGUI, Statement statement) { this.adminGUI = adminGUI; this.statement = statement; pieChartPanel = createPieChartPanel(); pieChartPanel.setBackground(Color.GRAY); pieChartPanel.setPreferredSize(new Dimension(550, 260)); northPanel = new JPanel(new FlowLayout()); northPanel.setBackground(Color.GRAY); clockPanel = new MyClock("Advanced"); northPanel.add(clockPanel);/*from ww w . j a v a 2 s . c o m*/ statsPanel = setFields(); add(northPanel, BorderLayout.NORTH); add(statsPanel, BorderLayout.CENTER); add(pieChartPanel, BorderLayout.SOUTH); setUpGUI(); }
From source file:Main.java
public Main() { setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT); JPanel buttonPanel = new JPanel(); okButton = new JButton("Ok"); buttonPanel.add(okButton);//w ww . ja va2s.c o m add(buttonPanel, BorderLayout.SOUTH); mainPanel = new JPanel(); mainPanel.setLayout(new GridLayout(0, 3)); add(mainPanel, BorderLayout.CENTER); JSpinner defaultSpinner = new JSpinner(); addRow("Default", defaultSpinner); JSpinner boundedSpinner = new JSpinner(new SpinnerNumberModel(5, 0, 10, 0.5)); addRow("Bounded", boundedSpinner); String[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames(); JSpinner listSpinner = new JSpinner(new SpinnerListModel(fonts)); addRow("List", listSpinner); JSpinner reverseListSpinner = new JSpinner(new SpinnerListModel(fonts) { public Object getNextValue() { return super.getPreviousValue(); } public Object getPreviousValue() { return super.getNextValue(); } }); addRow("Reverse List", reverseListSpinner); JSpinner dateSpinner = new JSpinner(new SpinnerDateModel()); addRow("Date", dateSpinner); JSpinner betterDateSpinner = new JSpinner(new SpinnerDateModel()); String pattern = ((SimpleDateFormat) DateFormat.getDateInstance()).toPattern(); betterDateSpinner.setEditor(new JSpinner.DateEditor(betterDateSpinner, pattern)); addRow("Better Date", betterDateSpinner); JSpinner timeSpinner = new JSpinner(new SpinnerDateModel()); pattern = ((SimpleDateFormat) DateFormat.getTimeInstance(DateFormat.SHORT)).toPattern(); timeSpinner.setEditor(new JSpinner.DateEditor(timeSpinner, pattern)); addRow("Time", timeSpinner); JSpinner permSpinner = new JSpinner(new PermutationSpinnerModel("meat")); addRow("Word permutations", permSpinner); }
From source file:SplashScreenTest.java
/** * This method displays a frame with the same image as the splash screen. *//*w w w .j a v a 2s .c om*/ private static void init2() { final Image img = Toolkit.getDefaultToolkit().getImage(splash.getImageURL()); final JFrame splashFrame = new JFrame(); splashFrame.setUndecorated(true); final JPanel splashPanel = new JPanel() { public void paintComponent(Graphics g) { g.drawImage(img, 0, 0, null); } }; final JProgressBar progressBar = new JProgressBar(); progressBar.setStringPainted(true); splashPanel.setLayout(new BorderLayout()); splashPanel.add(progressBar, BorderLayout.SOUTH); splashFrame.add(splashPanel); splashFrame.setBounds(splash.getBounds()); splashFrame.setVisible(true); new SwingWorker<Void, Integer>() { protected Void doInBackground() throws Exception { try { for (int i = 0; i <= 100; i++) { publish(i); Thread.sleep(100); } } catch (InterruptedException e) { } return null; } protected void process(List<Integer> chunks) { for (Integer chunk : chunks) { progressBar.setString("Loading module " + chunk); progressBar.setValue(chunk); splashPanel.repaint(); // because img is loaded asynchronously } } protected void done() { splashFrame.setVisible(false); JFrame frame = new JFrame(); frame.setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setTitle("SplashScreenTest"); frame.setVisible(true); } }.execute(); }