I have this code and I was wondering if it was possible to input a search into google through my java program. For example when the user inputs google it will open google.com and the program will automatically fill the search in from another string they entered. For example if the userInput string was google.com:what year is it?
How could I make the program search "what year is it?" in the browser?
else if(userInput.contains("google.com")) {
try {
Desktop.getDesktop().browse(new URL("http://google.com").toURI());
}
catch (Exception e) {}
}