posted 13 years ago
Thanks Both of you but any one tell me how to use gridbaglayout insted of setbounds...
this.getContentPane().setBackground(Color.WHITE);
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
this.setLayout(null);
getLogoLabel().setIcon(new ImageIcon(getClass().getResource("/Images/Vm_img.png")));
getLogoLabel().setBounds(5,0,220,50);
this.add(getLogoLabel());
getVbmlogoLabel().setIcon(new ImageIcon(getClass().getResource("/Images/vmlogo2.png")));
getVbmlogoLabel().setBounds(350,180,250,200);
this.add(getVbmlogoLabel());
getReleaseVersionLable().setBounds(800,10,200,25);
getReleaseVersionLable().setFont(new Font("Courier New", Font.ITALIC, 11));
this.add(getReleaseVersionLable());
getReleaseVersionDataLable().setBounds(970,10,200,25);
getReleaseVersionDataLable().setFont(new Font("Courier New", Font.ITALIC, 11));
this.add(getReleaseVersionDataLable());
getPowerByLable().setBounds(30,600,300,25);
getPowerByLable().setForeground(c);
getPowerByLable().setFont(new Font("Courier New", Font.ITALIC, 11));
this.add(getPowerByLable());
this.setBackground(Color.BLACK);
this.setTitle("VBM Data Review - Login");
this.setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/Images/icon.png")));
/* myParams.getLabelHead().setBounds(500,30,300,25);
this.add(myParams.getLabelHead());*/
getPanel().setBounds(650,150,400,300);
getPanel().setBorder(BorderFactory.createLineBorder(null));
getPanel().setLayout(null);
getPanel().setBackground(Color.WHITE);
getUserNameLabel().setBounds(30,100,150,25);
getPanel().add(getUserNameLabel());
getUserTextField().setBounds(150, 100, 150, 25);
getPanel().add(getUserTextField());
getPasswordLabel().setBounds(30, 150, 150, 25);
getPanel().add(getPasswordLabel());
getPasswordTextField().setBounds(150, 150, 150, 25);
getPanel().add(getPasswordTextField());
Color c= Color.decode("#6495ED");
getSubmitButton().setBounds(150,220,150,25);
getSubmitButton().setBackground(c);
getSubmitButton().setForeground(Color.WHITE);
getPanel().add(getSubmitButton());
getMassegelabel().setBounds(15,255,400,15);
getMassegelabel().setFont(new Font("Curier New", Font.ITALIC, 11));
getPanel().add(getMassegelabel());
/*getResetButton().setBounds(620,300,100,25);
this.add(getResetButton());
getExitButton().setBounds(740,300,100,25);
this.add( getExitButton());*/
this.add(getPanel());
this.getRootPane().setDefaultButton(getSubmitButton());
this.getSubmitButton().addNotify();
//this.setSize(1000,500);
this.setResizable(false);
this.setSize(screensize.width,screensize.height);