How to refresh a page using java?
I have figured out how to start a page: Code:
public static void displayURL(String url, int buyingprice)
{
boolean windows = isWindowsPlatform();
String cmd = null;
try
{
if (windows)
{
cmd = WIN_PATH + " " + WIN_FLAG + " " + url;
Process p = Runtime.getRuntime().exec(cmd);
}
}
catch(IOException x)
{
System.err.println("Could not invoke browser, command=" + cmd);
System.err.println("Caught: " + x);
}
}
public static boolean isWindowsPlatform()
{
String os = System.getProperty("os.name");
if ( os != null && os.startsWith(WIN_ID))
return true;
else
return false;
}
But how can I now refresh that page?
Re: How to refresh a page using java?
Where is the page being displayed?
Is there an API that you can call to ask the page displayer to refresh the page?
It looks like the page being displayed by another independent application.
The Robot class would be able to move the cursor and press it anywhere on the screen.