A
alex_us01
hi,
I tried to use JLayeredPane as follows and nothing in it shows up.
What is the problem?
thanks,
alex
--------------
import java.awt.*;
import javax.swing.*;
public class LPTry {
public static void main(String[] args) {
JFrame jf = new JFrame();
jf.getContentPane().setLayout(new BorderLayout());
JLabel tlabel = new JLabel("east");
jf.getContentPane().add(tlabel, BorderLayout.EAST);
JLayeredPane lpane = new JLayeredPane();
tlabel = new JLabel("center bottom");
lpane.add(tlabel, JLayeredPane.DEFAULT_LAYER);
jf.getContentPane().add(lpane, BorderLayout.CENTER);
jf.pack();
jf.setVisible(true);
}
}
I tried to use JLayeredPane as follows and nothing in it shows up.
What is the problem?
thanks,
alex
--------------
import java.awt.*;
import javax.swing.*;
public class LPTry {
public static void main(String[] args) {
JFrame jf = new JFrame();
jf.getContentPane().setLayout(new BorderLayout());
JLabel tlabel = new JLabel("east");
jf.getContentPane().add(tlabel, BorderLayout.EAST);
JLayeredPane lpane = new JLayeredPane();
tlabel = new JLabel("center bottom");
lpane.add(tlabel, JLayeredPane.DEFAULT_LAYER);
jf.getContentPane().add(lpane, BorderLayout.CENTER);
jf.pack();
jf.setVisible(true);
}
}