this.selected = ((scroll.getValue() + tilex) * (height + 1)) + tiley;
if ((tilex <= width) && (tiley <= height)) this.selected = ((scroll.getValue() + tilex) * (height + 1)) + tiley;
    	public void setSelected(int newselectedx, int newselectedy)    	{ 		    		int tilex = newselectedx / MapEditor.tileWidth;    		int tiley = newselectedy / MapEditor.tileHeight;    		    		this.selected = ((scroll.getValue() + tilex)    				* (height + 1)) + tiley;    	}