import javax.swing.JFrame;
import java.awt.FlowLayout;
import javax.swing.JCheckBox;
import javax.swing.ImageIcon;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
class ShowJCheckBox extends JFrame implements ActionListener{
FlowLayout flowLayout1=new FlowLayout();
JCheckBox jCheckBox1=new JCheckBox("修改数据权限");
JCheckBox jCheckBox2=new JCheckBox("遍历数据权限",true);
ImageIcon imageIcon1=new ImageIcon("G:\\简历
\\Img225634302.JPEG");
JCheckBox jCheckBox3=new JCheckBox("录入数据权限",imageIcon1);
JCheckBox jCheckBox4=new JCheckBox();
ShowJCheckBox(){
super("复选框示例");
setSize(200,150);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setResizable(true);
this.getContentPane().setLayout(flowLayout1);
this.getContentPane().add(jCheckBox1);
this.getContentPane().add(jCheckBox2);
this.getContentPane().add(jCheckBox3);
jCheckBox4.setText("系统权限");
this.getContentPane().add(jCheckBox4);
jCheckBox4.addActionListener(this);
jCheckBox3.addActionListener(this);
setVisible(true);
}
public void actionPerformed(ActionEvent e){
if(e.getSource()==jCheckBox3){
if(jCheckBox3.isSelected()){
ImageIcon imageIcon2=new ImageIcon("G:\\简历
\\zhouxingchi.JPEG");
jCheckBox3.setSelectedIcon(imageIcon2);
}
}
if(e.getSource()==jCheckBox4){
if(jCheckBox4.isSelected()) System.out.println("系统权限复选取框被选中.");
else System.out.println("系统权限复选框未被选中");
}
}
public static void main(String args[]){
ShowJCheckBox showJCheckBox1=new ShowJCheckBox();
}
}
就找这个吧,还有别的程序也找不到图片!谢谢了!