Example usage for java.awt BorderLayout WEST

List of usage examples for java.awt BorderLayout WEST

Introduction

In this page you can find the example usage for java.awt BorderLayout WEST.

Prototype

String WEST

To view the source code for java.awt BorderLayout WEST.

Click Source Link

Document

The west layout constraint (left side of container).

Usage

From source file:pcgen.gui2.filter.SearchFilterPanel.java

public SearchFilterPanel() {
    searchField.getDocument().addDocumentListener(this);
    clearButton.addActionListener(this);
    setLayout(new BorderLayout());
    add(new JLabel(LanguageBundle.getString("in_filterLabel")), BorderLayout.WEST);
    add(searchField, BorderLayout.CENTER);
    add(clearButton, BorderLayout.EAST);
}

From source file:SwingWorkerProcessor.java

public SwingWorkerFrame() {
    this.setDefaultCloseOperation(EXIT_ON_CLOSE);
    Container contentPane = this.getContentPane();
    cancelButton.setEnabled(false);//from  w  w w. ja  v  a  2 s.  co  m

    contentPane.add(statusLabel, BorderLayout.NORTH);
    contentPane.add(startButton, BorderLayout.WEST);
    contentPane.add(cancelButton, BorderLayout.EAST);

    startButton.addActionListener(e -> startProcessing());
    cancelButton.addActionListener(e -> cancelProcessing());
}

From source file:Sketch.java

public Sketch() {
    super(true);/*from w w w. ja va 2  s . c om*/

    setLayout(new BorderLayout());
    board = new JPanel(true);
    board.setPreferredSize(new Dimension(300, 300));
    board.setBorder(new LineBorder(Color.black, 5));

    clear = new JButton("Clear Drawing Area");
    clear.addActionListener(this);

    shuttle1 = new JogShuttle(0, 300, 150);
    lastX = shuttle1.getValue();
    shuttle2 = new JogShuttle(0, 300, 150);
    lastY = shuttle2.getValue();

    shuttle1.setValuePerRevolution(100);
    shuttle2.setValuePerRevolution(100);

    shuttle1.addPropertyChangeListener(this);
    shuttle2.addPropertyChangeListener(this);

    shuttle1.setBorder(new BevelBorder(BevelBorder.RAISED));
    shuttle2.setBorder(new BevelBorder(BevelBorder.RAISED));

    add(board, BorderLayout.NORTH);
    add(shuttle1, BorderLayout.WEST);
    add(clear, BorderLayout.CENTER);
    add(shuttle2, BorderLayout.EAST);
}

From source file:QandE.SwingApp1.java

void createGUI(JFrame f) {
    startButton = new JButton("Start");
    stopButton = new JButton("Stop");
    label = new JLabel("Press Start.", JLabel.CENTER);

    Container c = f.getContentPane();
    //Use the content pane's default BorderLayout layout manager.
    c.add(startButton, BorderLayout.WEST);
    c.add(stopButton, BorderLayout.EAST);
    c.add(label, BorderLayout.SOUTH);
}

From source file:org.ut.biolab.medsavant.client.view.util.PeekingPanel.java

public PeekingPanel(String label, String borderLayoutPosition, JComponent panel, boolean isExpanded, int size) {

    final boolean isVertical = borderLayoutPosition.equals(BorderLayout.EAST)
            || borderLayoutPosition.equals(BorderLayout.WEST);

    this.setAnimated(false);

    if (borderLayoutPosition.equals(BorderLayout.NORTH)) {
        dockedSide = DockedSide.NORTH;/* ww  w  .  j  a  v  a  2  s .co m*/
        this.setDirection(JXCollapsiblePane.Direction.UP);
    } else if (borderLayoutPosition.equals(BorderLayout.SOUTH)) {
        dockedSide = DockedSide.SOUTH;
        this.setDirection(JXCollapsiblePane.Direction.DOWN);
    } else if (borderLayoutPosition.equals(BorderLayout.EAST)) {
        dockedSide = DockedSide.EAST;
        this.setDirection(JXCollapsiblePane.Direction.RIGHT);
    } else {
        dockedSide = DockedSide.WEST;
        this.setDirection(JXCollapsiblePane.Direction.LEFT);
    }

    this.setLayout(new BorderLayout());
    this.panel = panel;

    if (isVertical) {
        panel.setPreferredSize(new Dimension(size, 999));
    } else {
        panel.setPreferredSize(new Dimension(999, size));
    }
    titlePanel = new JPanel();

    titlePanel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    titlePanel.setBorder(ViewUtil.getTinyBorder());
    if (isVertical) {
        titlePanel.setLayout(new BoxLayout(titlePanel, BoxLayout.Y_AXIS));
    } else {
        titlePanel.setLayout(new BoxLayout(titlePanel, BoxLayout.X_AXIS));
    }
    titlePanel.add(Box.createHorizontalGlue());

    this.titleString = label.toUpperCase();
    title = new JLabel(" ");//titleString);

    title.setForeground(Color.darkGray);
    if (borderLayoutPosition.equals(BorderLayout.EAST)) {
        title.setUI(new VerticalLabelUI(true));
    } else if (borderLayoutPosition.equals(BorderLayout.WEST)) {
        title.setUI(new VerticalLabelUI(false));
    }
    titlePanel.add(title);

    if (!isVertical) {
        titlePanel.add(Box.createHorizontalGlue());
    }

    titlePanel.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            toggleExpanded();
        }
    });

    this.add(titlePanel, borderLayoutPosition);
    this.add(panel, BorderLayout.CENTER);

    setExpanded(isExpanded);
}

From source file:Main.java

public CheckBoxNodeRenderer() {
    p.setFocusable(false);

    p.setOpaque(false);
    p.add(check, BorderLayout.WEST);
    check.setOpaque(false);
}

From source file:org.csml.tommo.sugar.modules.heatmap.MixedHeatmapDialog.java

public MixedHeatmapDialog(int row, int col, MixedResultsTable table) {
    super(row, col, table);

    add(createMixParameterSlider(), BorderLayout.WEST);
    MixOperationComboBox comboBox = createMixOperationComboBox();
    comboBox.setSelectedItem(MixOperation.fromMixer(mixOperation));
    add(comboBox, BorderLayout.NORTH);
}

From source file:brainflow.core.ImageBrowser.java

private void initSourceView() {
    sourceView = new JList();
    final DefaultListModel model = new DefaultListModel();
    for (IImageSource source : sourceList.sourceList) {
        model.addElement(source);/* w  w w. j  ava 2s. c  om*/
    }

    sourceView.setModel(model);
    sourceView.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    ButtonPanel panel = new ButtonPanel(SwingConstants.CENTER);

    JButton nextButton = new JButton("Next");
    ImageIcon icon = new ImageIcon(getClass().getClassLoader().getResource("icons/control_play_blue.png"));
    nextButton.setIcon(icon);

    JButton prevButton = new JButton("Previous");
    icon = new ImageIcon(getClass().getClassLoader().getResource("icons/control_rev_blue.png"));
    prevButton.setIcon(icon);
    panel.addButton(prevButton);
    panel.addButton(nextButton);
    panel.setSizeConstraint(ButtonPanel.SAME_SIZE);

    JPanel container = new JPanel(new BorderLayout());
    container.setBorder(new TitledBorder("Image List"));
    container.add(new JScrollPane(sourceView), BorderLayout.CENTER);
    container.add(panel, BorderLayout.SOUTH);
    add(container, BorderLayout.WEST);

    nextButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            int index = sourceView.getSelectedIndex();
            if (index == (sourceList.size() - 1)) {
                index = 0;
            } else {
                index++;
            }

            updateView(index);

        }
    });

    sourceView.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
        @Override
        public void valueChanged(ListSelectionEvent e) {
            int index = sourceView.getSelectedIndex();
            if (currentModel.getSelectedLayer().getDataSource() != sourceView.getSelectedValue()) {
                System.out.println("updating view");
                updateView(index);
            } else {
                System.out.println("not updating view ");
            }

        }
    });
}

From source file:ButtonScroll.java

public ButtonScroll() {
    super("Scrolling Programmatically");
    setSize(400, 400);/*from  w ww.  ja  v  a 2s .c o  m*/
    getContentPane().setLayout(new BorderLayout());

    ImageIcon shuttle = new ImageIcon("largeJava2sLogo.GIF");
    pgVertical = shuttle.getIconHeight() / 5;
    pgHorzontal = shuttle.getIconWidth() / 5;
    JLabel lbl = new JLabel(shuttle);

    viewport = new JViewport();
    viewport.setView(lbl);
    viewport.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            enableButtons(ButtonScroll.this.viewport.getViewPosition());
        }
    });
    getContentPane().add(viewport, BorderLayout.CENTER);

    JPanel pv = new JPanel(new BorderLayout());
    upButton = createButton("up", 'u');
    ActionListener lst = new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            movePanel(0, -1);
        }
    };
    upButton.addActionListener(lst);
    pv.add(upButton, BorderLayout.NORTH);

    downButton = createButton("down", 'd');
    lst = new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            movePanel(0, 1);
        }
    };
    downButton.addActionListener(lst);
    pv.add(downButton, BorderLayout.SOUTH);
    getContentPane().add(pv, BorderLayout.EAST);

    JPanel ph = new JPanel(new BorderLayout());
    leftButton = createButton("left", 'l');
    lst = new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            movePanel(-1, 0);
        }
    };
    leftButton.addActionListener(lst);
    ph.add(leftButton, BorderLayout.WEST);

    rightButton = createButton("right", 'r');
    lst = new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            movePanel(1, 0);
        }
    };
    rightButton.addActionListener(lst);
    ph.add(rightButton, BorderLayout.EAST);
    getContentPane().add(ph, BorderLayout.SOUTH);

    WindowListener wndCloser = new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            System.exit(0);
        }
    };
    addWindowListener(wndCloser);

    setVisible(true);
    movePanel(0, 0);
}

From source file:savant.view.swing.Ruler.java

public Ruler() {

    this.mousePosition = new JLabel();
    this.mousePosition.setHorizontalAlignment(SwingConstants.CENTER);
    this.add(this.mousePosition, BorderLayout.CENTER);

    this.recStart = new JLabel();
    this.add(this.recStart, BorderLayout.WEST);

    this.recStop = new JLabel();
    this.add(this.recStop, BorderLayout.EAST);

    this.cords = new JLabel();
    this.add(this.cords, BorderLayout.NORTH);

    graphPaneController.addListener(new Listener<GraphPaneEvent>() {
        @Override//w  w w  .j ava2  s. c  o m
        public void handleEvent(GraphPaneEvent event) {
            if (graphPaneController.isPanning()) {
                repaint();
            }
        }
    });

    locationController.addListener(new Listener<LocationChangedEvent>() {
        @Override
        public void handleEvent(LocationChangedEvent event) {
            repaint();
        }
    });
}