I make an JLabel
and setIcon("back.gif") for it
then I new an JScrollPane with the label
and add ScrollPane in JFrame.
when the back.gif is 1050*722 size(105KB), I can browse it well in ScrollPane. Then I change to another pic of 2000*582(214KB), well yet.
But when I change to a pic of 2400*698(316KB), I can't see the pic,
only a gray panel without any scrollbar! I want to know why? Any suggestion ? For god's sake, help me, thanks a lot!
import java.awt.*;
import javax.swing.*;
public class MapTest extends JFrame {
public MapTest()
{
ImageIcon pic = new ImageIcon("back.gif");
JLabel label = new JLabel();
label.setLayout(null);
label.setIcon(pic);
JScrollPane
jsp = new JScrollPane(label);
getContentPane().add(jsp);
setSize(600, 400);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public static void main(
String[] args)
{
new MapTest();
}