Hello I am making a "Superclass" that provides a programmer easier means of constructing a java panel by providing a template so as not to reuse code over and over. I have reached a point where I am trying to allow the programmer to call one method with in my "Superclass" and it will then add three buttons onto the frame. The problem is that it will only show one button. I am trying to figure out a way to return these three buttons at the same time. can anyone help me the code is below
Component ButtonGroup(String ButtonName){
jButton1 = new JButton();
jButton1.setText(ButtonName);
jButton1.setBounds(161, 231, 100, 28);
ButtonGroup1(ButtonName);
ButtonGroup2(ButtonName);
return jButton1;
}
Component ButtonGroup1(String ButtonName){
jButton1 = new JButton();
jButton1.setText(ButtonName);
jButton1.setBounds(50, 231, 100, 28);
return jButton1;
}
Component ButtonGroup2(String ButtonName){
jButton2 = new JButton();
jButton2.setText(ButtonName);
jButton2.setBounds(300, 231, 100, 28);
return jButton2;
}