Java can be used for either a client application, containing the interface that the user will use for their tasks, or in a server application, receiving HTTP requests and responding the way you want.
In the first case, client-side application, you can make use of the Swing framework to mount the application windows and program the buttons and what you want most. And there are libraries to do the most varied things in GUI applications with Java, such as the Jfreecharts which allows plotting graphics in the window.
In the second case, as a server, you would make use of the Httprequests API to formulate, send, receive and process HTML requests. Some frameworks help a lot here, like Spring and Primefaces, this focused on the visual layer of the application. There is also the possibility to use the JEE edition, with features such as Servlets for processing and JSP for the pages that will be used to receive user data (forms).
In the mixed case, that Java acts as both a client and a server, you can use both of the above, provided that the connection between them is made.
Over databases, the connection is usually made by drivers and an API, the JDBC (JAva DminutesBase Connection). There are frameworks for this too, such as Hibernate.
The most important thing is to know what comes first.
– Maniero