Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Looking at content of JPanel

 
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am looking at a GUI display of information which I want to be able to access from my own Java classes. This is waht I see when I println() the object parent.
javax.swing.JPanel[null.contentPane,0,0,690x281,layout=javax.swing.BoxLayout,ali
gnmentX=null,alignmentY=null,border=,flags=50,maximumSize=,minimumSize=,preferre
dSize=,defaultLayout=java.awt.FlowLayout[hgap=5,vgap=5,align=center]]

The children are specific classes written by someone else. Can I get to the content somehow from what I have above? What is the significance of the 'null.contentPane' in the signature?
Thanks for any help.
Paul
 
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not quite sure what you mean by content. But in the Container getComponents() returns all of the components on the container. That will give you everything on the JPanel.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic