Example usage for javax.swing JPanel setPreferredSize

List of usage examples for javax.swing JPanel setPreferredSize

Introduction

In this page you can find the example usage for javax.swing JPanel setPreferredSize.

Prototype

@BeanProperty(preferred = true, description = "The preferred size of the component.")
public void setPreferredSize(Dimension preferredSize) 

Source Link

Document

Sets the preferred size of this component.

Usage

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

public BubbleChartDemo2(String s) {
    super(s);//from   w ww . j av a  2s  .co m
    JPanel jpanel = createDemoPanel();
    jpanel.setPreferredSize(new Dimension(500, 270));
    setContentPane(jpanel);
}

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

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

From source file:MainClass.java

MainClass() {
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    JPanel p = new JPanel();
    p.setPreferredSize(new Dimension(300, 50));
    JLabel jl = new JLabel("Name:");
    p.add(jl);/*from   ww w.j  av  a 2  s  .  c  o  m*/
    JTextField jtf = new JTextField(20);
    jtf.getAccessibleContext().setAccessibleName("Name-entry");
    p.add(jtf);

    AccessibleRelation ar = new AccessibleRelation("connector", jtf);

    AccessibleContext ac = jl.getAccessibleContext();
    ac.getAccessibleRelationSet().add(ar);

    getContentPane().add(p);

    pack();
    setVisible(true);
}

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

public StackedBarChartDemo6(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.XYErrorRendererDemo2.java

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

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

public XYStepAreaRendererDemo1(String s) {
    super(s);/*from   w  w w.  j  av a2 s  .c o m*/
    JPanel jpanel = createDemoPanel();
    jpanel.setPreferredSize(new Dimension(500, 300));
    setContentPane(jpanel);
}

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

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

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

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

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

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

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

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