List of usage examples for java.awt BorderLayout BorderLayout
public BorderLayout(int hgap, int vgap)
From source file:freemrs.ChartPanelDraw.java
public ChartPanelDraw(java.util.List<Vitals> result, String type) { this.type = type; this.result = result; dataset = createTimeDataset();/*w w w .ja va2s .c o m*/ chartPanel = createChart(dataset, type); JFrame f = new JFrame("Vital Plot"); //Jframe to draw the graph f.setTitle("Vital Plot"); f.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); f.setLayout(new BorderLayout(0, 5)); f.add(chartPanel, BorderLayout.CENTER); f.setIconImage(new ImageIcon(getClass().getResource("/images/icon_transparent.png")).getImage()); chartPanel.setHorizontalAxisTrace(true); //set properties of the graph chartPanel.setVerticalAxisTrace(true); chartPanel.setMouseWheelEnabled(true); JPanel panel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); panel.add(createTrace()); //Add components to panel panel.add(createDate()); panel.add(createZoom()); f.add(panel, BorderLayout.SOUTH); f.pack(); f.setLocationRelativeTo(null); f.setVisible(true); }
From source file:my.jabbr.app.ftpclient.ui.install.ProductLicenseInstallationPanel.java
private void initComponents() { try {/*from w w w.j a va2 s. co m*/ String licenseStr = FileUtils.readFileToString(new File(ConfigManager.GPL_LICENSE_FILE)); licenseText = new JTextArea(licenseStr); licenseText.setColumns(20); licenseText.setRows(15); licenseText.setBorder(BorderFactory.createLineBorder(UIAccessories.BORDER_GRAY)); licenseText.setBackground(UIAccessories.WHITE); licenseText.setEditable(false); JScrollPane scrollPane = new JScrollPane(licenseText); scrollPane.setBorder(null); scrollPane.setOpaque(false); scrollPane.getViewport().setOpaque(false); scrollPane.getViewport().setBorder(null); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); setLayout(new BorderLayout(20, 20)); add(createTransparentFillerPanel(), BorderLayout.NORTH); add(scrollPane, BorderLayout.CENTER); } catch (IOException e) { e.printStackTrace(); } this.setOpaque(false); }
From source file:EHRAppointment.ChartPanelDraw.java
/** * * @param result// w w w .ja v a2 s . co m * @param type */ public ChartPanelDraw(java.util.List<Vitals> result, String type) { this.type = type; this.result = result; dataset = createTimeDataset(); chartPanel = createChart(dataset, type); JFrame f = new JFrame("Vital Plot"); //Jframe to draw the graph f.setTitle("Vital Plot"); f.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); f.setLayout(new BorderLayout(0, 5)); f.add(chartPanel, BorderLayout.CENTER); f.setIconImage(new ImageIcon(getClass().getResource("/images/icon_transparent.png")).getImage()); chartPanel.setHorizontalAxisTrace(true); //set properties of the graph chartPanel.setVerticalAxisTrace(true); chartPanel.setMouseWheelEnabled(true); JPanel panel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); panel.add(createTrace()); //Add components to panel panel.add(createDate()); panel.add(createZoom()); f.add(panel, BorderLayout.SOUTH); f.pack(); f.setLocationRelativeTo(null); f.setVisible(true); }