List of usage examples for javax.swing JFrame setContentPane
@BeanProperty(bound = false, hidden = true, description = "The client area of the frame where child components are normally inserted.") public void setContentPane(Container contentPane)
contentPane
property. From source file:LayeredPaneDemo.java
public static void main(String[] args) { JFrame frame = new JFrame("LayeredPaneDemo"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // Create and set up the content pane. JComponent newContentPane = new LayeredPaneDemo(); newContentPane.setOpaque(true); // content panes must be opaque frame.setContentPane(newContentPane); // Display the window. frame.pack();/*from ww w . java2 s.c o m*/ frame.setVisible(true); }
From source file:uk.ac.lkl.cram.ui.chart.LearningExperienceChartMaker.java
/** * For testing purposes only// w w w . j a v a 2s.co m * @param args the command line arguments (ignored) */ public static void main(String[] args) { JFrame frame = new JFrame("Learning Experience Test"); Module m = AELMTest.populateModule(); LearningExperienceChartMaker maker = new LearningExperienceChartMaker(m); frame.setContentPane(maker.getChartPanel()); frame.setSize(300, 300); frame.setVisible(true); }
From source file:Main.java
public static void main(String[] args) { JFrame f = new JFrame(); Box b = Box.createVerticalBox(); JTextField field1 = new JTextField(); JTextField field2 = new JTextField(); field1.setMaximumSize(new Dimension(Integer.MAX_VALUE, field1.getPreferredSize().height)); field2.setMaximumSize(new Dimension(Integer.MAX_VALUE, field2.getPreferredSize().height)); b.add(field1);/*w w w.j a va 2 s . co m*/ b.add(field2); b.add(Box.createVerticalGlue()); f.setContentPane(b); f.setSize(500, 200); f.setVisible(true); }
From source file:uk.ac.lkl.cram.ui.chart.LearningTypeChartMaker.java
/** * For testing purposes only//from ww w.j av a 2 s . c o m * * @param args the command line arguments (ignored) */ public static void main(String[] args) { JFrame frame = new JFrame("Learning Type Test"); Module m = AELMTest.populateModule(); LearningTypeChartMaker maker = new LearningTypeChartMaker(m); frame.setContentPane(maker.getChartPanel()); frame.setSize(300, 300); frame.setVisible(true); }
From source file:SampleTableModel.java
public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { @Override/* w ww . j av a 2 s.c om*/ public void run() { try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); } catch (Exception e) { } JFrame frame = new JFrame("Swing JTable"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JApplet applet = new SwingInterop(); applet.init(); frame.setContentPane(applet.getContentPane()); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); // applet.start(); } }); }
From source file:gov.llnl.lc.infiniband.opensm.plugin.gui.chart.PortHeatMapPlotPanel.java
/** * Starting point for the demonstration application. * * @param args/*w w w . java 2s .c o m*/ * ignored. */ public static void main(String[] args) { JFrame demo = new JFrame("HeatMap"); JPanel content = new PortHeatMapPlotPanel(); demo.setContentPane(content); demo.pack(); RefineryUtilities.centerFrameOnScreen(demo); demo.setVisible(true); }
From source file:TableRenderDemo.java
public static void main(String[] args) { JFrame frame = new JFrame("TableRenderDemo"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // Create and set up the content pane. TableRenderDemo newContentPane = new TableRenderDemo(); newContentPane.setOpaque(true); // content panes must be opaque frame.setContentPane(newContentPane); // Display the window. frame.pack();/* w ww . ja v a 2s .c om*/ frame.setVisible(true); }
From source file:ecg.ecgshow.ECGShowUI.java
/** * @param args the command line arguments *//*from w w w . j av a 2s . c om*/ public static void main(String args[]) { /* Create and display the form */ JFrame jFrame = new JFrame(); jFrame.setContentPane(new ECGShowUI("", 5000L).HeartRateData); jFrame.pack(); jFrame.setVisible(true); java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new ECGShowUI("ecg", 5000L).setVisible(true); } }); }
From source file:AccessibleScrollDemo.java
public static void main(String s[]) { JFrame frame = new JFrame("AccessibleScrollDemo"); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0);// www .ja v a2s.com } }); frame.setContentPane(new AccessibleScrollDemo()); frame.pack(); frame.setVisible(true); }
From source file:Main.java
public static void main(String[] args) throws UnsupportedEncodingException { JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel panel = new JPanel(new BorderLayout()); JPanel buttons = new JPanel(); JScrollPane pane = new JScrollPane(buttons); pane.getViewport().addChangeListener(e -> { System.out.println("Change in " + e.getSource()); System.out.println("Vertical visible? " + pane.getVerticalScrollBar().isVisible()); System.out.println("Horizontal visible? " + pane.getHorizontalScrollBar().isVisible()); });//w w w.j a v a2 s . co m panel.add(pane); frame.setContentPane(panel); frame.setSize(300, 200); frame.setVisible(true); SwingWorker<Void, Void> worker = new SwingWorker<Void, Void>() { @Override protected Void doInBackground() throws Exception { for (int i = 0; i < 10; i++) { Thread.sleep(800); buttons.add(new JButton("Hello " + i)); buttons.revalidate(); } return null; } }; worker.execute(); }