关于JAVA布局管理器的问题
p1=newJPanel();p1.setLayout(newFlowLayout(0,5,5));this.setLayout(null);p1.setSize(950...
p1 =new JPanel();
p1.setLayout(new FlowLayout(0,5,5));
this.setLayout(null);
p1.setSize(950,650);
Jbok.setPreferredSize(new Dimension(100,120));
grass1 = new JLabel();
grass2 = new JLabel();
p1.add(grass1);
p1.add(grass2);
p1.add(Jbok);
this.setSize(950,650);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setResizable(false);
label.setBounds(0, 0,usicon.getIconWidth()-420, usicon.getIconHeight());
this.getLayeredPane().setLayout(null);
this.getLayeredPane().add(label, new Integer(Integer.MIN_VALUE));
super.setContentPane(p1);
p1.setOpaque(false);
this.setVisible(true);
简单的说下问题,当画布和框架的布局管理器都设为NULL时,无法显示控件,求高手解答 展开
p1.setLayout(new FlowLayout(0,5,5));
this.setLayout(null);
p1.setSize(950,650);
Jbok.setPreferredSize(new Dimension(100,120));
grass1 = new JLabel();
grass2 = new JLabel();
p1.add(grass1);
p1.add(grass2);
p1.add(Jbok);
this.setSize(950,650);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setResizable(false);
label.setBounds(0, 0,usicon.getIconWidth()-420, usicon.getIconHeight());
this.getLayeredPane().setLayout(null);
this.getLayeredPane().add(label, new Integer(Integer.MIN_VALUE));
super.setContentPane(p1);
p1.setOpaque(false);
this.setVisible(true);
简单的说下问题,当画布和框架的布局管理器都设为NULL时,无法显示控件,求高手解答 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询