简体   繁体   中英

How can I make a java application hosted locally on a pc and controll it using a web interface and call methods from classes to be run on the computer

I would like to create a java application with a gui. I wish that the gui will be constucted as a web page and locally hosted. The aim is to go to the ip of my computer using my phone and see the interface and I could controll the program from my mobile phone via the web page and from my inputs certain functions take effect on the pc hosting the program.

Web app built with Vaadin

Use the Vaadin Flow framework to build your web app in Java. Define your UI as Java objects, Button, TextField, Grid, etc. At runtime, Vaadin automatically generates all the necessary HTML, CSS, and JavaScript necessary to render that UI in the user's web browser.

On your local PC, install any Jakarta Servlet web container of your choice such as Tomcat, Jetty, Glassfish/Payara, WildFly/JBoss, etc. Your PC is now acting as a web server.

Open necessary ports on your firewall or do port-forwarding to allow the HTTP traffic through.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM