如何在背景图画上加按钮?
如何在背景图上加按钮??!!!!我想做个一固定资产管理系统的主界面
代码如下:
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class MainFrame extends JFrame{
private JLabel jl_picture;
private Panel p_right;
private Panel p_Left;
private Button btn_personmanage;
private Button btn_toolmanage;
private Button btn_lend;
private Button btn_back;
private Button btn_select;
private Button btn_change;
private ImageIcon ii;
String showname;
public MainFrame(){
super();
this.setTitle("主信息表");
p_right=new Panel();
p_right.setLayout(new GridLayout(14,1));
jl_picture=new JLabel();
ii=new ImageIcon("D:\\Pro\\Images\\4.jpg");
jl_picture=new JLabel("");
jl_picture.setSize(800,600);
jl_picture.setIcon((Icon)ii);
this.getContentPane().add(jl_picture);
btn_personmanage=new Button("固定资产信息管理");
btn_personmanage.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
ToolsManage tm=new ToolsManage();
tm.setVisible(true);
dispose();
}
});
btn_toolmanage=new Button("人员信息管理");
btn_toolmanage.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
PersonManage pm=new PersonManage();
pm.setVisible(true);
dispose();
}
});
btn_lend=new Button("资产的领用");
btn_lend.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
LendTools lt=new LendTools();
lt.setVisible(true);
dispose();
}
});
btn_back=new Button("资产的归还");
btn_back.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
BackTools bt=new BackTools();
bt.setVisible(true);
dispose();
}
});
btn_select=new Button("资产信息浏览和查询");
btn_select.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
}
});
btn_change=new Button("修改密码");
btn_change.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
Update up=new Update();
up.setVisible(true);
dispose();
}
});
p_right.add(new Label());
p_right.add(new Label());
p_right.add(btn_change);
p_right.add(new Label());
p_right.add(btn_personmanage);
p_right.add(new Label());
p_right.add(btn_toolmanage);
p_right.add(new Label());
p_right.add(btn_lend);
p_right.add(new Label());
p_right.add(btn_back);
p_right.add(new Label());
p_right.add(btn_select);
p_right.add(new Label());
add(jl_picture,"Center");
add(p_right,"East");
setSize(800,600);
setVisible(true);
}
public static void main(String[] args){
MainFrame mf=new MainFrame();
}
}
以上代码运行结果是 左边出现背景图 右边是按钮,
我现在觉得这样的布局比较丑,想把按钮放到背景图上,
但不知道怎么去实现
请大家帮我修改一下...急求
我是用JCreator做的