I am trying to make a simple program that makes use of JTable.. actually I am using netbeans IDE to make the interfaces.. although i have this contactsListTable(jtable) and by default it doesn't have any data. The data is only loaded when the program is executed, how do I add data to jtable using a code??

You actually need to add the data to the TableModel. You can either implement the TabelModel yourself against your existing data (whether that is in an array, list, or whatever) or create an instance of DefaultTableModel with your data. Read through these for more info and examples:
http://www2.sys-con.com/ITSG/VirtualCD_Spring05/Java/archives/0405/hatmaker/index.html
http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.