public static void main(String[] args) { Plot2D test = new Plot2D(); JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.add(test.getContent()); f.add(test.getUIPanel(), "Last"); f.setSize(400, 400); f.setLocation(50, 50); f.setVisible(true); }
public static final void initialize(JPanel sceneHolder) { MazeWindow scene = new MazeWindow(frame); scene.setPreferredSize(new Dimension(500, 500)); sceneHolder = new JPanel(); sceneHolder.add(scene); frame.add(sceneHolder); }
public static void main(String[] args) { JFrame frame = new JFrame(); frame.setSize(800, 600); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); GamePanel game = new GamePanel(); frame.add(game); frame.setVisible(true); }
public static void main(String[] args) { JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); f.add(new GraphingData()); f.setSize(515, 310); f.setLocation(0, 420); f.setVisible(true); }
public static void main(String[] args) { JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(600, 500); frame.setTitle("Breakout"); frame.setResizable(false); frame.add(new GamePanel()); frame.setVisible(true); }
public static void main(String[] args) { frame.setLayout(new FlowLayout()); final JPanel sceneHolder = new JPanel(); initialize(sceneHolder); frame.add(sceneHolder); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(700, 700); frame.setVisible(true); }
public static void main(String[] args) { int a = ROW * PREFERRED_GRID_SIZE_PIXELS; int b = ROW * PREFERRED_GRID_SIZE_PIXELS; BuildArray(); SquareGrid test = new SquareGrid(); JFrame f = new JFrame(); f.setTitle("ObjectVis"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.add(test); // setPreferredSize(new Dimension(80, 50)); f.setSize(a, 800); // f.setSize(f.MAXIMIZED_HORIZ, f.MAXIMIZED_VERT); Dimension d = f.getMaximumSize(); // int m=f.MAXIMIZED_BOTH; // f.setMaximumSize(d); // f.setLocation(100,100); f.setVisible(true); f.setJMenuBar(test.addMenu()); test.addComponentListener(test.cl); f.setJMenuBar(test.addMenu()); }
public static void main(String args[]) { JFrame win = new JFrame(); win.setSize(400, 400); win.add(new MyCanvs()); win.setVisible(true); }
public LJ3MDApp() { tNum.setHorizontalAlignment(JTextField.CENTER); tTemp.setHorizontalAlignment(JTextField.CENTER); tRho.setHorizontalAlignment(JTextField.CENTER); tSpeed.setHorizontalAlignment(JTextField.CENTER); tAvK.setHorizontalAlignment(JTextField.RIGHT); tAvU.setHorizontalAlignment(JTextField.RIGHT); tAvp.setHorizontalAlignment(JTextField.RIGHT); float[] aveKing = new float[501]; float[] avePot = new float[501]; float[] aveEn = new float[501]; JFrame box = new JFrame(); box.setLayout(new BorderLayout()); box.setSize(1000, 1000); box.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); cpnl = new JPanel(); // create a panel for controls cpnl.setLayout(new GridLayout(18, 2)); box.add(cpnl, BorderLayout.EAST); // add controls cpnl.add(bStart); bStart.addActionListener(this); cpnl.add(bReset); bReset.addActionListener(this); cpnl.add(new JLabel(" N:")); tNum.addActionListener(this); cpnl.add(tNum); cpnl.add(new JLabel(" Density (\u03c1):")); tRho.addActionListener(this); cpnl.add(tRho); cpnl.add(new JLabel(" Steps/frame:")); tSpeed.addActionListener(this); cpnl.add(tSpeed); cpnl.add(bTstat); bTstat.addActionListener(this); cpnl.add(bPot); bPot.addActionListener(this); cpnl.add(new JLabel(" < K/N > :")); tAvK.setEditable(false); cpnl.add(tAvK); cpnl.add(new JLabel(" Temperature:")); tTemp.setEditable(false); cpnl.add(tTemp); cpnl.add(new JLabel(" < U/N > :")); tAvU.setEditable(false); cpnl.add(tAvU); cpnl.add(new JLabel(" < pressure > :")); tAvp.setEditable(false); cpnl.add(tAvp); cpnl.add(bRetime); bRetime.addActionListener(this); spnl = new JPanel(); // create a panel for status box.add(spnl, BorderLayout.SOUTH); lStatus.setFont(new Font("Courier", 0, 12)); spnl.add(lStatus); canvas = new XYZCanvas(); box.add(canvas, BorderLayout.CENTER); timer = new Timer(delay, this); timer.start(); // timer.stop(); box.setVisible(true); }