Example usage for java.awt Dimension Dimension

List of usage examples for java.awt Dimension Dimension

Introduction

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

Prototype

public Dimension(int width, int height) 

Source Link

Document

Constructs a Dimension and initializes it to the specified width and specified height.

Usage

From source file:org.jfree.chart.demo.XYErrorRendererDemo1.java

public XYErrorRendererDemo1(String s) {
    super(s);/*  w  ww . j a  va 2s  .com*/
    JPanel jpanel = createDemoPanel();
    jpanel.setPreferredSize(new Dimension(500, 270));
    setContentPane(jpanel);
}

From source file:org.jfree.chart.demo.XYSeriesDemo1.java

public XYSeriesDemo1(String s) {
    super(s);/*from  ww  w . jav a  2 s.c o  m*/
    XYDataset xydataset = createDataset();
    JFreeChart jfreechart = createChart(xydataset);
    ChartPanel chartpanel = new ChartPanel(jfreechart);
    chartpanel.setPreferredSize(new Dimension(500, 270));
    setContentPane(chartpanel);
}

From source file:org.jfree.chart.demo.HistogramDemo1.java

public HistogramDemo1(String s) {
    super(s);
    JPanel jpanel = createDemoPanel();
    jpanel.setPreferredSize(new Dimension(500, 270));
    setContentPane(jpanel);
}

From source file:org.jfree.chart.demo.CompassDemo1.java

public CompassDemo1(String s) {
    super(s);// w  w  w .  java  2 s .  c  om
    DefaultValueDataset defaultvaluedataset = new DefaultValueDataset(new Double(45D));
    JFreeChart jfreechart = createChart(defaultvaluedataset);
    ChartPanel chartpanel = new ChartPanel(jfreechart);
    chartpanel.setPreferredSize(new Dimension(500, 270));
    chartpanel.setEnforceFileExtensions(false);
    setContentPane(chartpanel);
}

From source file:Main.java

public void build() {
    setSize(600, 600);/*ww  w  . j  av a  2  s .  c  o m*/
    JTextPane textPane = new JTextPane();

    JScrollPane scrollPane = new JScrollPane(textPane);
    scrollPane.setPreferredSize(new Dimension(300, 300));

    JTextArea changeLog = new JTextArea(5, 30);
    changeLog.setEditable(false);
    JScrollPane scrollPaneForLog = new JScrollPane(changeLog);

    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, scrollPane, scrollPaneForLog);
    splitPane.setOneTouchExpandable(true);

    JPanel statusPane = new JPanel(new GridLayout(1, 1));
    JLabel caretListenerLabel = new JLabel("Caret Status");
    statusPane.add(caretListenerLabel);

    JToolBar toolBar = new JToolBar();
    toolBar.add(new JButton("Btn1"));
    toolBar.add(new JButton("Btn2"));
    toolBar.add(new JButton("Btn3"));
    toolBar.add(new JButton("Btn4"));

    getContentPane().add(toolBar, BorderLayout.PAGE_START);
    getContentPane().add(splitPane, BorderLayout.CENTER);
    getContentPane().add(statusPane, BorderLayout.PAGE_END);

    JMenu editMenu = new JMenu("test");
    JMenu styleMenu = new JMenu("test");
    JMenuBar mb = new JMenuBar();
    mb.add(editMenu);
    mb.add(styleMenu);
    setJMenuBar(mb);

}

From source file:org.jfree.chart.demo.BubbleChartDemo1.java

public BubbleChartDemo1(String s) {
    super(s);//from w  w w  .j a  va  2 s.c o  m
    JPanel jpanel = createDemoPanel();
    jpanel.setPreferredSize(new Dimension(500, 270));
    setContentPane(jpanel);
}

From source file:org.jfree.chart.demo.MeterChartDemo1.java

public MeterChartDemo1(String s) {
    super(s);/*from  w  ww. ja v  a 2s. c om*/
    JPanel jpanel = createDemoPanel();
    jpanel.setPreferredSize(new Dimension(500, 270));
    setContentPane(jpanel);
}

From source file:org.jfree.chart.demo.VectorPlotDemo1.java

public VectorPlotDemo1(String s) {
    super(s);//from  w w  w  . ja  v  a  2s  .com
    JPanel jpanel = createDemoPanel();
    jpanel.setPreferredSize(new Dimension(500, 270));
    setContentPane(jpanel);
}

From source file:Main.java

public Main() {
    setLayout(new BorderLayout());
    String text = "<html>one<br>two<br><a name =\"three\"></a>three<br>four<br>five<br>six<br>seven<br>eight<br>nine<br>ten</html>";
    StringReader reader = new StringReader(text);

    html = new JEditorPane();
    html.setContentType("text/html");

    try {/*from w  w  w  .  j a va 2s. com*/
        html.read(reader, null);
    } catch (Exception e) {
        System.out.println(e);
    }

    JScrollPane scrollPane = new JScrollPane(html);
    scrollPane.setPreferredSize(new Dimension(400, 100));
    add(scrollPane);
    html.scrollToReference("three");

}

From source file:Main.java

@Override
public Dimension getPreferredSize() {
    return new Dimension(400, 300);
}