I have 2 ButtonGroups which I want to have separate titled borders for. This is the code I'm using to set it up but it doesn't work. Can someone have a suggestion? I'm just a beginner.
JPanel sizePanel = new JPanel();
ButtonGroup style = new ButtonGroup();
sizePanel.setBorder(BorderFactory.createTitledBord er("Varietal"));
chardonnay = new JRadioButton("Chalone");
cabernet = new JRadioButton("Silver Oak");
zinfandel = new JRadioButton("Oppolo");
style.add(chardonnay);
style.add(cabernet);
style.add(zinfandel);
panel1.add(chardonnay);
panel1.add(cabernet);
panel1.add(zinfandel);
ButtonGroup bottle = new ButtonGroup();
sizePanel.setBorder(BorderFactory.createTitledBord er("Bottle Size"));
split = new JRadioButton("Split");
fifth = new JRadioButton("Fifth");
magnum = new JRadioButton("Magnum");
bottle.add(split);
bottle.add(fifth);
bottle.add(magnum);
panel1.add(split);
panel1.add(fifth);
panel1.add(magnum);