if (height > screen.height + 55) { height = screen.height - 255;
while (height + 55 > screen.height - 75) { height -= 75;
	public imageViewer(String image) {		setTitle(image);		getContentPane().setLayout(new BorderLayout());		filename = image;		imagePanel ip = new imagePanel(image);		JScrollPane jspane = new JScrollPane(ip);		getContentPane().add("Center", jspane);		Dimension screen = getToolkit().getScreenSize();		Dimension im = ip.getMaximumSize();		int width = im.width;		int height = im.height;		if (width > screen.width + 15) {			width = screen.width - 215;		}		if (height > screen.height + 55) {			height = screen.height - 255;		}		setBounds((screen.width - width + 15)/2, 				(screen.height - height + 55)/2, 							width + 15, 								height + 55);		addWindowListener(new WindowAdapter() {			public void windowClosing(WindowEvent evt) {				dispose(); 			}		});		Box box = Box.createHorizontalBox();      		JButton b = new JButton("Save");		b.addActionListener(BListener);		box.add(b);		b = new JButton("Exit");		b.addActionListener(BListener);		box.add(b);		getContentPane().add("South", box);		show();	}