1) Create a saved search or schedule search (As per your requirement) per Dashboard Panels.
2) Use Splunk Java SDK to connect with Splunk and execute searches to get data in your required output mode.
Refer below link for examples.
I hope this will help you.
If any of my replies help you to solve the problem Or gain knowledge, an upvote would be appreciated.