I am migrating ‘Java Swing’ code from ‘Java Visual Cafe’ JDK1.2 to ‘Eclipse SDK6’. In Visual Cafe it has code is like this:
public Sample extends JPanel(){
.....
package com.symantec.itools.javax.swing.JButtonGroupPanel bgAcc = new com.symantec.itools.javax.swing.JButtonGroupPanel();
....
bgAcc.setBorder(tbAcc); //tbAcc is titledBorder component type
..
bgAcc.setBounds(0,108,400,76);
...
bgAcc.add(bgLb); // bgLb is JLabel component type
..
bgAcc.add(button1, new GridBagConstraints(...));
..
}
Can anyone suggest how I can replace this code in Eclipse SDK6? I am unable find these methods for ‘ButtonGroup’ in ‘Swing’.
I am not familiar wit the
JButtonGroupPanelclass, but those methods you use are all available on a regularJPanelas well.ButtonGroupis a completely different concept in Swing then aJPanel. AButtonGroupis for example used to group a set ofJRadioButtons, and makes sure that only one radio button in that group can be selected at the time. But aButtonGroupis not aJComponentnor aContainer, so of course you will not find methods likesetBorderon it.Side-note: do not port those
setBoundscalls. Use a decentLayoutManagerinstead