List of usage examples for javax.swing JFrame setVisible
public void setVisible(boolean b)
From source file:Main.java
public static void main(String[] args) { JFrame aWindow = new JFrame(); aWindow.setBounds(200, 200, 200, 200); aWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); aWindow.setCursor(Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR)); aWindow.setVisible(true); }
From source file:Main.java
public static void main(String[] args) { Main cicd = new Main(); JFrame f = new JFrame("Chooser In Current Dir"); f.add(cicd.getGui());//from w ww . jav a 2 s . c om f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); f.pack(); f.setVisible(true); }
From source file:Main.java
public static void main(String[] args) { JFrame aWindow = new JFrame(); aWindow.setBounds(200, 200, 200, 200); aWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); aWindow.setCursor(Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR)); aWindow.setVisible(true); }
From source file:BoundedChangeListener.java
public static void main(String args[]) { ChangeListener changeListener = new BoundedChangeListener(); JScrollBar aJScrollBar = new JScrollBar(JScrollBar.HORIZONTAL); BoundedRangeModel model = aJScrollBar.getModel(); model.addChangeListener(changeListener); JFrame frame = new JFrame("ScrollBars R Us"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(aJScrollBar, BorderLayout.NORTH); frame.setSize(300, 200);/*w w w . j a v a 2s. co m*/ frame.setVisible(true); }
From source file:DoubleBufferWithBufferedImage.java
public static void main(String[] a) { JFrame f = new JFrame(); f.setSize(300, 300);/*from w ww . j a v a 2 s . c o m*/ f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.getContentPane().add(new DoubleBufferWithBufferedImage()); f.setVisible(true); }
From source file:Main.java
public static void main(String[] args) { JEditorPane htmlPane = new JEditorPane(); String description = "<html><body>Hello<table border=1>" + "<tr><td><img alt='Bad' src='http://www.java2s.com/style/download.png'/></tr></td></table></body></html>"; htmlPane.setContentType("text/html"); htmlPane.setText(description);//from ww w . jav a 2s .com JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLayout(new BorderLayout()); frame.add(new JScrollPane(htmlPane)); frame.pack(); frame.setVisible(true); }
From source file:Main.java
public static void main(String[] args) { JFrame aWindow = new JFrame(); aWindow.setBounds(200, 200, 200, 200); aWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); aWindow.setCursor(Cursor.getPredefinedCursor(Cursor.SW_RESIZE_CURSOR)); aWindow.setVisible(true); }
From source file:Main.java
public static void main(String[] args) { JFrame aWindow = new JFrame(); aWindow.setBounds(200, 200, 200, 200); aWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); aWindow.setCursor(Cursor.getPredefinedCursor(Cursor.NW_RESIZE_CURSOR)); aWindow.setVisible(true); }
From source file:Main.java
public static void main(String[] args) { JPanel mainPanel = new JPanel(); JTextField field = new JTextField(20); JTextField field1 = new JTextField(20); field.getDocument().addDocumentListener(new DocumentListener() { @Override/* ww w . j av a 2 s. co m*/ public void changedUpdate(DocumentEvent e) { updateLabel(e); } @Override public void insertUpdate(DocumentEvent e) { updateLabel(e); } @Override public void removeUpdate(DocumentEvent e) { updateLabel(e); } private void updateLabel(DocumentEvent e) { field1.setText(field.getText()); } }); mainPanel.setLayout(new GridLayout(1, 0, 10, 0)); mainPanel.add(field); mainPanel.add(field1); JFrame frame = new JFrame(); frame.getContentPane().add(mainPanel); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setVisible(true); }
From source file:Main.java
public static void main(String[] args) { JFrame aWindow = new JFrame(); aWindow.setBounds(200, 200, 200, 200); aWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); aWindow.setCursor(Cursor.getPredefinedCursor(Cursor.NE_RESIZE_CURSOR)); aWindow.setVisible(true); }