高手请帮我实现一下 《窗口+滚动条》显示缩略图的问题!!付上我的代码
void showmini(String path){
Show play = new Show();
JPanel pnlmain = new JPanel();
pnlmain.setLayout(null);
JScrollPane js = new JScrollPane(pnlmain);
js.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
play.add(js);
File mulu = new File(path);
String []zhong = mulu.list();
Vector jihe = new Vector();
for (int i = 0; i < zhong.length;i++) {
String bi = zhong[i].substring(zhong[i].lastIndexOf( ". ")+1);
if ((bi.equals( "JPG ")) || (bi.equals( "BMP ")) ||
(bi.equals( "GIF ")) || (bi.equals( "jpg ")) ||
(bi.equals( "bmp ")) || (bi.equals( "gif "))) {
jihe.add(zhong[i]);
}
}
JPanel []fi;
JLabel []tu;
JLabel []zi;
Object []guankan = jihe.toArray();
for(int i=0,x=20,y=23;i <guankan.length;i++){
fi = new JPanel[guankan.length];
tu = new JLabel[guankan.length];
zi = new JLabel[guankan.length];
fi[i] = new JPanel();
fi[i].setLayout(null);
fi[i].setBounds(x,y,90,90);
pnlmain.add(fi[i]);