public void init() { b1.addActionListener(bl); b2.addActionListener(bl); Container cp = getContentPane(); cp.setLayout(new FlowLayout()); cp.add(b1); cp.add(b2); cp.add(txt); }
public void init() { Container cp = getContentPane(); cp.add(sines); cycles.addChangeListener( new ChangeListener() { public void stateChanged(ChangeEvent e) { sines.setCycles(((JSlider) e.getSource()).getValue()); } }); cp.add(BorderLayout.SOUTH, cycles); }