怎么把login和password以及后面的文本框移下去
package test;
import java.awt.Container;
import java.io.File;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
class BackgroundFrame extends JFrame{
public BackgroundFrame(){
super.setTitle("test background");
container = this.getContentPane();
textField = new JTextField(30);
passwordField = new JPasswordField();
imgLabel = new JLabel(image);
this.getLayeredPane().add(imgLabel, new Integer(Integer.MIN_VALUE));
label1 = new JLabel("login");
label2 = new JLabel("password");
imgLabel.setBounds(0, 0, image.getIconWidth(), image.getIconWidth());
label1.setBounds(10, 10, 120, 20);
label2.setBounds(10, 35, 120, 20);
textField.setBounds(135, 10, 120, 20);
passwordField.setBounds(135, 35, 120, 20);
this.setLayout(null);
container.add(label1);
container.add(label2);
container.add(passwordField);
container.add(textField);
container.add(imgLabel);
((JPanel)container).setOpaque(false);//将container设置成透明
super.setSize(image.getIconWidth(), image.getIconHeight());
super.setLocation(200, 100);
super.setVisible(true);
}
private JTextField textField;
private JLabel imgLabel;
private JLabel label1;
private JLabel label2;
private JPasswordField passwordField;
private Container container;
private String picPath = "c:" +File.separator + "background1.jpg";
private Icon image = new ImageIcon(picPath);
}
public class testBackground {
public static void main(String[] args) {
new BackgroundFrame();
}
}
swing