[SWING]Adding JButton(class1) to JPanel(class2)
Hello, I have a problem. I have one class with the JButtons and one class with the JPanel. I want to add the JButtons from one class to the JPanel in another class. How do I do this?
I can get it to work if the buttons are in the JPanel class this.add(button). But how do I do when they are in two classes? I've played around with objects and peer-objects but no success because I'm so new to this.
I'm gonna have an ActionListener to the the buttons if that matters.