Results 1 to 2 of 2

Thread: JTable creation in swing

  1. #1
    Junior Member
    Join Date
    Feb 2007
    Answers
    1

    JTable creation in swing

    Hi,

    I am using NET BEANS 5.0 and JSDk1.4.2
    I need to populate table data in JTable in dynamically manner.

    I need code for that.

    Any one can help me out.

    Regards,
    Venkat.GJTable creation in swing
    Hi,

    I am using NET BEANS 5.0 and JSDk1.4.2
    I need to populate table data in JTable in dynamically manner.

    I need code for that.

    Any one can help me out.

    Regards,
    Venkat.G


  2. #2
    Contributing Member
    Join Date
    Sep 2006
    Answers
    42

    Re: JTable creation in swing

    Hi Venkat,
    To add data to a table dynamically, you will have to extend javax.swing.table.AbstractTableModel. In this class there is a method called getValueAt(rowIndex, colIndex). This method is a call back method that is called whenever the table is repainted. So you will have to implement this method to return the values. The parameters passed are the rowIndex and the colIndex.

    Hope this helps. Consult the Java API's for description of the other methods present in the AbstractTableModel.

    Regards,
    Sahil.

    --Win as if you were used to it,
    loose like you enjoyed it for a change!!!



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact