Just a quick question here. I have a program in which I need to create a number of JPanels, which will then each contain some objects (usually JLabels).
There are a few operations that I have to do each time i create a new JPanel, and I'm wondering if the order in which I do them has any bearing, or if there is a standard practice.
The operations I do are the following:
Declare the JPanel: JPanel panel = new JPanel(...)
Declare the JLabel: JLabel laberl = new JLabel...
Add the JPanel to some other content pane: frame.getContentPane().add(panel)
Set the bounds of the JPanel: panel.setBounds(...)
Add the JLabel to the JPanel: panel.add(label)