0

So I am making a GUI that the user inputs the username and password to login to my schools website. I then want it to open up the default browser and open multiple tabs to the schools website while being logged in. I'm not entirely sure how to be logged in when the browser opens. Any help would be appreciated.

Thanks

1
  • Any server side language? Mar 4, 2013 at 20:33

2 Answers 2

0

There are tool name Selenium. It is used for test GUI, so you can write "test" that login to the website and click, click, click... It use native browsers (IE, Firefox, Chrome) or special "Webrowser" that has no GUI but make all action in memory.

0

Use browse method to open the browser:

import java.net.URI;
import java.awt.Desktop; 

java.awt.Desktop desktop = java.awt.Desktop.getDesktop();
String arg="Your URI here";
java.net.URI uri = new java.net.URI( arg );
desktop.browse( uri );

Also note that you should catch a couple of exceptions, but I didn't use this in a while, so I don't really remember all of them, but I think you ought to check if java.awt.Desktop.Action.BROWSE is supported by desktop. Eclipse should anyway give you a hint, if you are using it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.