I have two arff files and I did K-Means clustering and take result of them. But I want to visualize on code with anything related Java them like Weka UI.(It's like a matplotlib in Python.). Is there anything will help on Weka or Java ?
Since I'm not sure what you are trying to plot (clusters assigned to instances? cluster centroids?), I can only give a vague answer. The simplest approach is probably to create a scatter plot (plotting value pairs) using JFreeChart. Here is a tutorial with code, which I tested with JFreeChart 1.0.19:
https://www.javatpoint.com/jfreechart-scatter-chart
That example displays two data series, but you can have any number of series in your plot (one or more).
For performing clustering using the Weka API, check out the manual that comes with your Weka installation. Alternatively, have a look at the Use weka in your java code article on the Weka wiki.
There is also the VisualizeClusterAssignments.java
example class that is part of the examples archive which comes with your Weka installation, which uses just Weka classes.
Here is a direct link to the 3.9.x version of that class: