Forums Register Login

how do I know what components are in a jpanel?

+Pie Number of slices to send: Send
Hi,
I have a JPanel with some components. How can I check if a JButton belongs to this JPanel?

Thanks!
+Pie Number of slices to send: Send
Hello,
In the AWT we have Container.getComponents() which returns an array of Components in the Container.
Note: javax.swing.JPanel is a subclass of java.awt.Container.
Good Luck,
-Dirk Schreckmann
It looks like it's time for me to write you a reality check! Or maybe a tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 894 times.
Similar Threads
setting background image in applet
JScrollPane
JPanel
Multiple components in cell of a JTable
Adding padding to GUI components
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 18, 2024 21:57:27.