Java JFrame is very strange
Posted
by rodion
on Stack Overflow
See other posts from Stack Overflow
or by rodion
Published on 2010-03-27T11:28:14Z
Indexed on
2010/03/27
11:33 UTC
Read the original article
Hit count: 190
When I am running this, JLabel is not visible, but when I resize window (with mouse) JLabel is showed. Why?
import javax.swing.*;
import java.awt.*;
public class FrmTaoLogin extends JFrame {
private JPanel pnlLeft = new JPanel();
public FrmTaoLogin() {
super();
pnlLeft.setBorder(BorderFactory.createEtchedBorder());
pnlLeft.add(new JLabel("test1"));
getContentPane().add(pnlLeft,BorderLayout.SOUTH);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setSize(200, 200);
}
public static void main(String[] args) {
FrmTaoLogin FrmLogin = new FrmTaoLogin();
FrmLogin.setVisible(true);
}
}
© Stack Overflow or respective owner