I have a class MyInternalFrame which extends JInternalFrame. The It has a JPanel which has a JEditorPane. In my Parentframe class extends JFrame I create a JDesktopPane as the content pane. I am trying to get the text from the JEditorPane in the MyInternalFrame class from the Parentframe class. How would I do that
Well, the easiest way would be to store a reference to the JEditorPane within MyInternalFrame when you create it, so that you can add a method to MyInternalFrame to get the text, and call that method from ParentFrame. Or, it's also possible to get all the components within a container, and then iterate over them, looking for the component you're looking for (the text field in this case).