I have a project in which I have added an image throuh JLabel
which is my background image. Now I want to add a transparent image through JLabel
image which has got some text over it. When I am adding my image over the background image it is disappearing. How to achieve it?
Here is the code of 2 labels lmain is the name of background image label and lblNewLabel is the name of the text image label.
JLabel lmain = new JLabel("");
lmain.setBounds(0, 0, 1600, 900);
pmain.add(lmian);
lmain.setIcon(new ImageIcon("C:\\Users\\Raabii Ansari\\Desktop\\k3.jpg"));
JLabel lblNewLabel = new JLabel("New label");
lblNewLabel.setBounds(502, 69, 498, 232);
lmain.add(lblNewLabel);
lblNewLabel.setIcon(new ImageIcon("C:\\Users\\Raabii Ansari\\Desktop\\text (4).gif"));