Example usage for javax.swing JFrame setVisible

List of usage examples for javax.swing JFrame setVisible

Introduction

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

Prototype

public void setVisible(boolean b) 

Source Link

Document

Shows or hides this Window depending on the value of parameter b .

Usage

From source file:PaintAllFontsFromGraphicEvironment.java

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

From source file:Main.java

public static void main(String[] argv) {
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add("Center", new Main());
    frame.pack();// w  w  w  . j a v  a  2  s  . c  o  m
    frame.setVisible(true);
}

From source file:Main.java

public static void main(String[] args) {
    JTextPane pane = new JTextPane();
    TabStop[] tabs = new TabStop[2];
    tabs[0] = new TabStop(60, TabStop.ALIGN_RIGHT, TabStop.LEAD_NONE);
    tabs[1] = new TabStop(100, TabStop.ALIGN_LEFT, TabStop.LEAD_NONE);
    TabSet tabset = new TabSet(tabs);

    StyleContext sc = StyleContext.getDefaultStyleContext();
    AttributeSet aset = sc.addAttribute(SimpleAttributeSet.EMPTY, StyleConstants.TabSet, tabset);
    pane.setParagraphAttributes(aset, false);
    pane.setText("\tright\tleft\tcenter\tValue\n" + "\t200.002\t200.002\t200.002\t200.002\n");

    JFrame d = new JFrame();
    d.setContentPane(new JScrollPane(pane));
    d.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    d.setSize(360, 120);/*www. j a v  a2  s.  c  om*/
    d.setVisible(true);
}

From source file:Translation.java

public static void main(String[] args) {
    JFrame frame = new JFrame("Translation");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.add(new Translation());
    frame.setSize(300, 200);/*from   w w w  .jav a2 s. c  om*/
    frame.setVisible(true);
}

From source file:InvokeAndWaitExample.java

public static void main(String[] a) {
    JFrame f = new JFrame();
    f.setDefaultCloseOperation(1);//  w  w w .j  a  v a2  s  .co m
    f.add(new InvokeAndWaitExample());
    f.pack();
    f.setVisible(true);
}

From source file:OvalPanelCanvas.java

public static void main(String args[]) {
    JFrame frame = new JFrame("Oval Sample");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.add(new OvalPanelCanvas());
    frame.setSize(300, 200);// w  w  w  .  ja  v  a 2 s .  c  om
    frame.setVisible(true);
}

From source file:HeaderlessSample.java

public static void main(String args[]) {
    Object rowData[][] = { { "Row1-Column1", "Row1-Column2", "Row1-Column3" },
            { "Row2-Column1", "Row2-Column2", "Row2-Column3" } };
    Object columnNames[] = { "Column 1", "Column 2", "Column 3" };
    //    JTable table = new HeaderlessTable(rowData, columnNames);
    JTable table = new JTable(rowData, columnNames);
    table.setTableHeader(null);// w  ww  .j  a v a  2  s .  co m
    JScrollPane scrollPane = new JScrollPane(table);
    //    scrollPane.setColumnHeaderView(null);
    JFrame frame = new JFrame("Headerless Table");
    frame.getContentPane().add(scrollPane, BorderLayout.CENTER);
    frame.setSize(300, 150);
    frame.setVisible(true);
}

From source file:Main.java

public static void main(String[] args) {
    JPanel p = new Main();

    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(p);//from   w w  w  .  j  av a  2  s .  co m
    frame.setSize(300, 300);

    frame.setVisible(true);
}

From source file:Main.java

public static void main(String[] args) {
    JFrame frame = new JFrame();
    frame.getContentPane().add(new Main());

    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    frame.setSize(200, 200);//from   w w  w  .j a  v a  2 s .  c o  m
    frame.setVisible(true);
}

From source file:Main.java

public static void main(String[] args) {
    JFrame frame = new JFrame("Hello!!");
    frame.setAlwaysOnTop(true);/*from   w  ww  .  j  a  va 2  s .  com*/
    frame.setLocationByPlatform(true);
    frame.add(new JLabel("  Always visible"));
    frame.pack();
    frame.setVisible(true);
}