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:TreeDISCONTIGUOUSSelection.java

public static void main(String[] argv) {
    JTree tree = new JTree();

    tree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);

    JFrame frame = new JFrame("tree DISCONTIGUOUS selection");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.add(new JScrollPane(tree));
    frame.setSize(380, 320);
    frame.setLocationRelativeTo(null);//  w w  w.j av a  2  s . co  m
    frame.setVisible(true);

}

From source file:GradientsRedYellow.java

public static void main(String[] args) {

    JFrame frame = new JFrame("GradientsRedYellow");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.add(new GradientsRedYellow());
    frame.setSize(350, 350);
    frame.setLocationRelativeTo(null);//from w ww  .j a v  a 2s .c om
    frame.setVisible(true);
}

From source file:ImageComposite.java

public static void main(String[] args) {
    JFrame frame = new JFrame();
    frame.add(new ImageComposite());
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(300, 210);
    frame.setVisible(true);/*from w  w w.  j  a va  2  s.c o m*/
}

From source file:Main.java

public static void main(String argv[]) {
    Main pane = new Main();
    for (int n = 1; n <= 4; n += 1) {
        pane.append(Color.black, String.valueOf(n) + ' ');
    }//from w w w . j a v  a  2  s  .c om
    JFrame f = new JFrame("ColorPane example");
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setContentPane(new JScrollPane(pane));
    f.setSize(600, 400);
    f.setVisible(true);
}

From source file:TransformTranslation.java

public static void main(String[] a) {
    JFrame f = new JFrame();
    f.getContentPane().add(new TransformTranslation());
    f.setSize(450, 350);
    f.show();// w  ww. j  av  a 2  s  .  c  o  m
}

From source file:TransformersRotation.java

public static void main(String[] a) {
    JFrame f = new JFrame();
    f.getContentPane().add(new TransformersRotation());
    f.setSize(350, 200);
    f.show();//from  w ww.j a  va 2  s.  c  o m
}

From source file:BlurredImage.java

public static void main(String[] args) {
    JFrame frame = new JFrame("Blurred Image");
    frame.add(new BlurredImage());
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(400, 400);
    frame.setLocationRelativeTo(null);/*from www .j  a va 2s .co m*/
    frame.setVisible(true);
}

From source file:StringRectPaintPanel.java

public static void main(String[] args) {

    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    frame.setContentPane(new StringRectPaintPanel());
    frame.setSize(500, 300);
    frame.setVisible(true);//from   w w w  .j  a v  a  2  s. c  o  m
}

From source file:MainClass.java

public static void main(String args[]) {
    Object rows[][] = { { "A", "a" }, { "B", "b" }, { "E", "e" } };
    Object headers[] = { "Upper", "Lower" };
    JTable table = new JTable(rows, headers);
    table.setTableHeader(null);/*  w  ww .ja  v a 2s .  c om*/
    JScrollPane scrollPane = new JScrollPane(table);
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.add(scrollPane, BorderLayout.CENTER);
    frame.setSize(300, 150);
    frame.setVisible(true);
}

From source file:TransparentRectangles.java

public static void main(String[] args) {

    JFrame frame = new JFrame("Transparent Rectangles");
    frame.add(new TransparentRectangles());
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(600, 100);
    frame.setVisible(true);//from   www. j  av  a2 s .c  om
}