Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

JInternalFrame - EditorFrame

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!