0

I have recently started to learn Java and I have a created my first desktop application using Swing. I now however, want to start my own little project that involves creating a desktop application that can retrieve and input data on a webpage.

Ideally, I would want to input and retrieve data from a webpage that is open and visible in a web browser (preferably Chrome), rather than doing it all behind the scenes where it cant be seen. I need my program to have a GUI written in Swing, which takes values and then inputs them onto the webpage; I need to be able to take values from the open webpage as well as be able to press buttons - all through my desktop app.

In conclusion you can say I need to create an application that automates a web browser, however it needs to be able to do it to an already open browser/webpage. What should I do and use to achieve this?

Frakcool
  • 10,915
  • 9
  • 50
  • 89
Tony Rath
  • 1
  • 1
  • Your best bet these days is either to sue an API to parse and manipulate a page in a browser, but I'd first look into embedding a [`WebView`](https://docs.oracle.com/javase/8/javafx/api/javafx/scene/web/WebView.html) which is Java-FX based. But note.. *"I have recently started to learn Java"* This is not a task suitable for a newbie. – Andrew Thompson Aug 31 '16 at 21:59
  • Have you looked at JMeter? That probably does what you want, although it'll use it's own browser. But it might be possible to use selenium webdriver to actually handle all that. See http://stackoverflow.com/questions/24424396/how-to-capture-the-screens-on-recording-and-playback-using-jmeter But yes, might not be the best thing to start with as a newbie... In any case, good luck! – Koos Gadellaa Aug 31 '16 at 22:39

1 Answers1

0

You can achieve this by applet programming in Java which can send request data to server web page. Additional to this you can use Web Service mechanism to where you can get data from your swing form and bind the request in any appropriate transfer method like XML or Json and you can post it on to server endpoint. For example in JAVA you can use Jersey rest implementation for this.

Chetan Verma
  • 735
  • 5
  • 10
  • Although i didnt understand any of this haha, im sure a little bit of googling with what you said will tell me what im looking for. Thanks! – Tony Rath Aug 31 '16 at 20:25
  • 2
    *"You can achieve this by applet programming in Java"* Applets are dead. See [Java Plugin support deprecated](http://www.gizmodo.com.au/2016/01/rest-in-hell-java-plug-in/) and [Moving to a Plugin-Free Web](https://blogs.oracle.com/java-platform-group/entry/moving_to_a_plugin_free). *"which can send request data to server web page."* Anything an applet can do, so can an application. – Andrew Thompson Aug 31 '16 at 21:57