I have created a form and added a container. I am trying to add a component to the container by using this code
Component container = new Container(new GridBagLayout());
try{
GridBagConstraints c = new GridBagConstraints();
c.fill = 2;
c.weightx = 0.2d;
c.gridx = 0;
c.gridy = 0;
container.addComponent((Object) c, new Label("My Label"));
....
} catch (Exception e)
{
}
However when use this code I get this error ...
cannot find symbol
symbol: method addComponent(Object,Component)
location: variable container of type Component
I have followed all the instructions on the website but I cannot seem to add this component
Thanks