Assuming you're using java.net.URLConnection, then call setRequestProperty(String,String) to set the request header to a value that IE would use. For example, to fake IE6:
URL url = new URL("http://google.com");
URLConnection connection = url.openConnection();
connection.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 1.2.30703)");
and then use the connection object as before.
But java.net is horrible. Use Apache Commons HttpClient instead, it's much nicer.
Even better, use a framework designed for navigating websites, like HtmlUnit