Forums Register Login

Display SPARQL result on Jtable

+Pie Number of slices to send: Send
Dears,
I create a SPARQL query and I want to display the result of this query on Jtable.
I do some research and based on previous post concerning this question I create this code, but unfortunately the table does not appear in my  interface. the result appear only in console
I'm sorry if this message seems stupid, but in general I'm beginner with Java and also with SPARQL
Thanks in advance
+Pie Number of slices to send: Send
Welcome to the Ranch

You shou‍ld call setVisible after everything else. Whatever is done in line 67 will not be visible.
Why are you using the keyword static so often?
+Pie Number of slices to send: Send
 

Campbell Ritchie wrote:Welcome to the Ranch

You shou‍ld call setVisible after everything else. Whatever is done in line 67 will not be visible.
Why are you using the keyword static so often?



Hello,
I call this method in line 70
this.setVisible(true);
but I think that my error was in while().
but I don't know where is exactly?
Thanks
+Pie Number of slices to send: Send
You shoul‍d run the query in a method of a different class. Don't mix business logic and display in the same class. Run that query and print out all the rows in the ersult set.Once you have got them printing out, you can then add them to a table model object and return that table model object to populate the table with. Are you using a DefaultTableModel? That does not override the toString method, but you should be able to get a Vector from it, and print that. Once you have done that, you should be able to work out whether all your rows are getting into the model or not.
I have forgotten just about everything I ever knew about JTable, so remind yourself about it in the Java™ Tutorials.
He's giving us the slip! Quick! Grab this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 993 times.
Similar Threads
Unable to populate Data in Jtable from Sparql result
Need component separator
Whom to setLayout JFrame or JPanel
How to update/refresh JPanel on JButton click?
labels on swing components
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 08:26:56.