How to call a child class object in a parent class action listener [closed]

6 days ago 2
ARTICLE AD BOX

I have two classes, Parent class and Child class. I need to call the Child class object when the button is clicked in the Parent class (action listener)

public class Parent extends JFrame{ private JButton showBtn; showBtn.addActionListener(e->{ }) } public class child{ public void something(){ } }

aled's user avatar

aled

26.6k4 gold badges36 silver badges52 bronze badges

Kavin Raj's user avatar

New contributor

Kavin Raj is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

9

Read Entire Article