The short answer is yes, because it JLabelis Container, so it can accept Component(a JLabelis a subclass Component) to add in JLabelusing the method add:
JLabel outsideLabel = new JLabel("Hello");
JLabel insideLabel = new JLabel("World");
outsideLabel.add(insideLabel);
In the code above, is insideLabeladded to outsideLabel.
However, a label appears visually with the text "Hello", so you cannot see the label that is contained in the label.
So, the question boils down to what really needs to be done by adding a label on top of another label.
Edit:
From the comments:
, , , , JLabel. 3 , . -, , , , jlabel, 3'mini jlabels ' jlabel. , , ..: |
, , Java.
, Java.
, GridLayout .
JPanel p = new JPanel(new GridLayout(0, 1));
p.add(new JLabel("One"));
p.add(new JLabel("Two"));
p.add(new JLabel("Three"));
JPanel GridLayout , JLabel s.