Example usage for javax.swing JFrame setSize

List of usage examples for javax.swing JFrame setSize

Introduction

In this page you can find the example usage for javax.swing JFrame setSize.

Prototype

public void setSize(int width, int height) 

Source Link

Document

The width and height values are automatically enlarged if either is less than the minimum size as specified by previous call to setMinimumSize .

Usage

From source file:MainClass.java

public static void main(String[] a) {
    JFrame f = new JFrame();
    f.setSize(400, 400);
    f.add(new MainClass());
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setVisible(true);/*from   ww  w .  j  a va2 s . co  m*/
}

From source file:Main.java

public static void main(String[] a) {
    JFrame f = new JFrame();
    f.setSize(400, 400);
    f.add(new Main());
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setVisible(true);//from ww w.  j  a va  2 s  .  c  o  m
}

From source file:GraphicsDrawChars.java

public static void main(String[] a) {
    JFrame f = new JFrame();
    f.setSize(400, 400);
    f.add(new GraphicsDrawChars());
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setVisible(true);//  w w w  .j av  a  2  s.c  o m
}

From source file:Main.java

public static void main(String[] argv) {
    int rows = 10;
    int cols = 5;
    JTable table = new JTable(rows, cols);
    JFrame f = new JFrame();
    f.setSize(300, 300);
    f.add(new JScrollPane(table));
    f.setVisible(true);//from  w  ww. j a va2  s .co  m

}

From source file:Main.java

public static void main(String[] argv) throws Exception {

    Object[][] cellData = { { "1-1", "1-2" }, { "2-1", "2-2" } };
    String[] columnNames = { "col1", "col2" };

    JTable table = new JTable(cellData, columnNames);

    JFrame f = new JFrame();
    f.setSize(300, 300);
    f.add(new JScrollPane(table));
    f.setVisible(true);/*from   ww  w  .  j a  v a2s.c o  m*/
}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    DefaultTableModel model = new DefaultTableModel();
    JTable table = new JTable(model);

    model.addColumn("Col1");
    model.addColumn("Col2");

    JFrame f = new JFrame();
    f.setSize(300, 300);
    f.add(new JScrollPane(table));
    f.setVisible(true);/* ww w . j ava 2  s.c  o m*/
}

From source file:Main.java

public static void main(String[] args) {
    JFrame f = new Main();
    f.setSize(300, 200);
    f.setVisible(true);/*from   w  w  w . j a v  a2s  . c o  m*/
}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    DefaultTableModel model = new DefaultTableModel();
    JTable table = new JTable(model);

    model.addColumn("Col1");
    model.addColumn("Col2");

    // Create the first row
    model.insertRow(0, new Object[] { "r1" });

    JFrame f = new JFrame();
    f.setSize(300, 300);
    f.add(new JScrollPane(table));
    f.setVisible(true);//from   ww w .j  a  v a2 s .com
}

From source file:Crop.java

public static void main(String args[]) {
    JFrame f = new Crop();
    f.setSize(200, 200);
    f.show();
}

From source file:PaintAllFontsFromGraphicEvironment.java

public static void main(String[] a) {
    JFrame f = new JFrame();
    f.setSize(400, 400);
    f.add(new PaintAllFontsFromGraphicEvironment());
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setVisible(true);//from   w w w  .j  a  va 2s  . co  m
}