/* * MedicijnenPanel.java * * Created on 29 mei 2006, 16:28 * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package zorgorganiser.medicijn; import zorgorganiser.gui.*; import zorgorganiser.util.*; import javax.swing.*; import java.awt.*; /** * * @author grit */ public class MedicijnenPanel extends JPanel { /** Creates a new instance of MedicijnenPanel */ public MedicijnenPanel() { setOpaque(false); setBorder(BorderFactory.createEmptyBorder()); //setLayout(null); TijdBalk b = new TijdBalk(500); b.setBounds(50, 50, 500, 200); add(b); } } class TijdBalk extends JPanel { JButton[] buttons = new JButton[8]; int width; public TijdBalk(int width) { super(new GridLayout(8, 2)); //setLayout(new GridLayout(8, 2)); for (int i = 0; i != buttons.length; ++i) { buttons[i] = new JButton("Button " + (i + 1)); buttons[i].setBounds(i * (width / 8), 0, (width / 8), (width / 8)); add(buttons[i]); } } }