Hi,
I have written this piece of code for my Project:
myFrame = new JFrame("MY FRAME");
myFrame.setVisible(true);
myFrame.setSize(800,600);
myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
myFrame.setLocationRelativeTo(null);
lp = myFrame.getLayeredPane();
Font myFont1 = new Font("Times New Roman",10,200);
Font myFont2 = new Font("Times New Roman",20,450);
myLabel1 = new JLabel("O");
//myLabel1.setFont(myFont1);
myLabel1.setBounds(20,20,50,50);
lp.add(myLabel1,new Integer(2));
myLabel2 = new JLabel("T");
//myLabel2.setFont(null);
myLabel2.setBounds(25,20,50,50);
lp.add(myLabel2,new Integer(1));
This overlapping of the JLabels works fine Until I uncomment the setFont() for the Labels.
As soon as I uncomment, I dont see anything in my Frame.
I want to increase the text sizes in JLabels sizes as per myFont1 and myFont2 and still overlap them.
Am I missing something?
Please help.