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:br.com.elotech.sits.config.dialog.ChooseFileDialog.java

public static File getFile(Frame owner, ChooseOption option) {

    ChooseFileDialog dialog = new ChooseFileDialog(owner,
            option == ChooseOption.FILE ? "Escolher arquivo" : "Escolher pasta", option, true);

    dialog.setMinimumSize(new Dimension(600, 400));

    dialog.setLocationRelativeTo(owner);

    dialog.setVisible(true);//from w ww .  j  a v  a  2  s  .co m

    return selFile;

}

From source file:kata.pkg3.HistogramaDisplay.java

private ChartPanel createPanel() {
    ChartPanel chartPanel = new ChartPanel(createChart(createDataset()));
    chartPanel.setPreferredSize(new Dimension(500, 450));
    return chartPanel;

}

From source file:MainClass.java

public LabelAccessory(JFileChooser chooser) {
    chooser.addPropertyChangeListener(this);
    setPreferredSize(new Dimension(100, 100));
}

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

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

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

public XYBarChartDemo7(String s) {
    super(s);//  w w w.j a v a2  s. c  om
    JPanel jpanel = createDemoPanel();
    jpanel.setPreferredSize(new Dimension(500, 300));
    setContentPane(jpanel);
}

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

public XYLineAndShapeRendererDemo1(String s) {
    super(s);//from  ww w. j  a  v  a 2s  . co  m
    XYDataset xydataset = createDataset();
    JFreeChart jfreechart = createChart(xydataset);
    ChartPanel chartpanel = new ChartPanel(jfreechart);
    chartpanel.setPreferredSize(new Dimension(500, 300));
    setContentPane(chartpanel);
}

From source file:Main.java

public Main() {
    editorPane.setDocument(doc);/*from   w w w  .  j  av  a 2  s .co  m*/
    editorPane.setEditorKit(styledEditorKit);
    JScrollPane scrollpane = new JScrollPane(editorPane);
    scrollpane.setPreferredSize(new Dimension(500, 400));
    JPanel comboPanel = new JPanel();
    comboPanel.add(fontBox);

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

    Document doc = editorPane.getDocument();
    for (int i = 0; i < 20; i++) {
        int offset = doc.getLength();
        String str = "This is line number: " + i + "\n";
        try {
            doc.insertString(offset, str, null);
        } catch (BadLocationException e) {
            e.printStackTrace();
        }
    }

    fontBox.addActionListener(e -> {
        int size = (Integer) fontBox.getSelectedItem();
        Action fontAction = new StyledEditorKit.FontSizeAction(String.valueOf(size), size);
        fontAction.actionPerformed(e);
    });
}

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

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

From source file:Main.java

@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
        boolean cellHasFocus) {

    JLabel label = new JLabel() {
        public Dimension getPreferredSize() {
            return new Dimension(200, 100);
        }//from   w  ww.ja  v a2s.  c o  m
    };
    label.setText(String.valueOf(value));

    return label;
}

From source file:Main.java

Main() {
    JFrame jfrm = new JFrame("JTable Demo");
    jfrm.setLayout(new FlowLayout());
    jfrm.setSize(460, 180);/* ww w .jav  a2s.  c  o  m*/
    jfrm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JScrollPane jscrlp = new JScrollPane(jtabOrders);
    jtabOrders.setPreferredScrollableViewportSize(new Dimension(420, 60));

    jtabOrders.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    jfrm.setVisible(true);

    jtabOrders.setColumnSelectionAllowed(false);
    jtabOrders.setRowSelectionAllowed(true);
}