Example usage for java.awt BorderLayout BorderLayout

List of usage examples for java.awt BorderLayout BorderLayout

Introduction

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

Prototype

public BorderLayout() 

Source Link

Document

Constructs a new border layout with no gaps between components.

Usage

From source file:GradientPanel.java

public GradientPanel(int direction) {
    super(new BorderLayout());
    setOpaque(false);
    this.direction = direction;
}

From source file:netplot.BarPlotPanel.java

public BarPlotPanel() {
    super(new BorderLayout());
    init();
}

From source file:org.uncommons.maths.demo.GraphPanel.java

public GraphPanel() {
    super(new BorderLayout());
    add(chartPanel, BorderLayout.CENTER);
}

From source file:commonline.query.gui.Frame.java

public Frame(boolean isMac, List<RecordParserDataSource> dataSources, CommonlineRecordRepository repository)
        throws HeadlessException {
    super("Commonline Query File Tool");
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    getContentPane().setLayout(new BorderLayout());

    openAction = new OpenAction(isMac, this, repository);
    clearDatabaseAction = new ClearDatabaseAction(isMac, this, dataSources);
    executeScriptAction = new ExecuteScriptAction(isMac, dataSources);
    stopScriptAction = new StopScriptAction(isMac);

    initializeMenu(isMac);//from ww  w  . java  2  s. com
    initializeView(executeScriptAction, stopScriptAction);

    for (RecordParserDataSource dataSource : dataSources) {
        MetaDataAnalyzer.instance().analyze(dataSource);
    }

    setSize(800, 600);
    setLocationByPlatform(true);
}

From source file:Sketch.java

public Sketch() {
    super(true);/*from  w  w w. jav a2  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:Main.java

MyPanel() {
    JScrollPane scrollpane = new JScrollPane();
    scrollpane.setViewport(viewport);/*w w  w.j a va 2  s  .  co m*/
    viewport.add(innerPanel);
    scrollpane.setPreferredSize(SCROLLPANE_SIZE);
    viewport.addChangeListener(e -> {
        Rectangle viewRect = viewport.getViewRect();
        if (viewRect.intersects(RECT)) {
            statusLabel.setText(VISIBLE);
        } else {
            statusLabel.setText(NOT_VISIBLE);
        }
    });

    setLayout(new BorderLayout());
    add(scrollpane, BorderLayout.CENTER);
    add(statusLabel, BorderLayout.SOUTH);
}

From source file:au.org.ala.delta.ui.TextFileViewer.java

public TextFileViewer(Window owner, File file) throws IOException {
    super(owner);
    setModal(true);/*  ww w. ja v  a  2s  .  c o m*/
    getContentPane().setLayout(new BorderLayout());
    viewer = new JTextPane();

    viewer.setEditable(false);
    viewer.setBackground(Color.WHITE);
    viewer.setBorder(null);
    viewer.setOpaque(true);
    viewer.setFont(UIManager.getFont("Label.font"));

    JScrollPane scroller = new JScrollPane(viewer);
    getContentPane().add(scroller, BorderLayout.CENTER);

    setTitle(file.getAbsolutePath());
    displayFileContents(file);
    pack();
}

From source file:it.unibo.alchemist.boundary.gui.asmc.SimplePlot.java

/**
 * Default constructor./*w w  w.j a  v  a 2  s.  c  o m*/
 */
public SimplePlot() {
    super();
    this.setLayout(new BorderLayout());
    final JPanel placeHolder = new JPanel();
    final JLabel wait = new JLabel("Please wait.");
    placeHolder.add(wait);
    this.add(placeHolder, BorderLayout.NORTH);
}

From source file:ClockDemo.java

/**
 * The init method is called when the browser first starts the applet. It
 * sets up the Label component and obtains a DateFormat object
 *///from ww  w . j a v a  2s .  c om
public void init() {
    time = new Label();
    time.setFont(new Font("helvetica", Font.BOLD, 12));
    time.setAlignment(Label.CENTER);
    setLayout(new BorderLayout());
    add(time, BorderLayout.CENTER);
    timeFormat = DateFormat.getTimeInstance(DateFormat.MEDIUM);
}

From source file:com.philng.telemetrydisplay.GraphDisplay.java

/**
 * Build all the initial data/*from   www .  ja va 2  s .  c o  m*/
 */
public GraphDisplay() {
    voltage = new TimeSeries("Voltage");
    current = new TimeSeries("Current");

    this.setLayout(new BorderLayout());
    final JFreeChart chart = createChart(createDatasetVoltage());

    final ChartPanel chartPanel = new ChartPanel(chart);

    add(chartPanel, BorderLayout.CENTER);
    chartPanel.setVisible(true);
    setVisible(true);

    // Add a mouse listener for when the user double clicks the mousse
    // on the graph, it will reset the zoome
    ChartMouseListener cml = new ChartMouseListener() {
        @Override
        public void chartMouseClicked(ChartMouseEvent chartMouseEvent) {
            if (chartMouseEvent.getTrigger().getClickCount() == 2) {
                chartPanel.restoreAutoBounds();
            }
        }

        @Override
        public void chartMouseMoved(ChartMouseEvent chartMouseEvent) {

        }
    };
    chartPanel.addChartMouseListener(cml);
}