java - Parsed data display in JTable -


i new java. have display xml parsed data parent nodes on jtabbedpane , child nodes in jtable respective jtabbedpane. parsing have used sax parser , data displayed in 3 jtextarea, have created tabbedpane , displayed hardcoded string title not able set jtable values.

public class jtabledisplay {     public jtabledisplay() {         jframe frame = new jframe("jtable test display");          jpanel panel = new jpanel();         panel.setlayout(new borderlayout());          jtable table = new jtable();          jscrollpane tablecontainer = new jscrollpane(table);          panel.add(tablecontainer, borderlayout.center);         frame.getcontentpane().add(panel);          frame.pack();         frame.setvisible(true);     }      public static void main(string[] args) {         new jtabledisplay();     } } 

this sample create jtable after have arrange parsed data in.

it there. not showing data.

to make table visible, try defining columns , rows table via constructor :

 jtable table = new jtable(3,4); 

get it?

now need define tablemodel , set.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -