菜鸟求救!高手请帮我1下
下面是我想用一个带滚动的窗口显示path路径下的文件夹里面的图片的缩略图 但是只能显示1个窗口那么多的图片 滚动条不起作用了 请帮我改1下
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();