Results 1 to 7 of 7
  1. #1
    pratim is offline Member
    Join Date
    Mar 2011
    Posts
    8
    Rep Power
    0

    Default Problem in giving row header name in a JTable

    Hi everyone, i have a problem in giving row header name to a JTable. My requirement is that....

    name: raj raja rahul

    dept: Chemical Mechanical Electrical

    salary: 20000 21000 25000

    I am maintaining a database table for this having the following fields.i could able to display using metadata like this....
    name dept salary
    raj Chemical 20000
    raja Mechanical 21000
    rahul Electrical 25000

    Is it possible to show just as my requirements. i am still trying to get but still no sign of any success. i do not know whether i could explain it properly or not. Sorry for my english.

    Can anyone help me to get out of my problem.

    Thank you in advance.

  2. #2
    dlorde is offline Senior Member
    Join Date
    Jun 2008
    Posts
    339
    Rep Power
    7

    Default

    It's not clear to me exactly what the problem is, but the commonest problem with table headers is that they only appear automatically when the table is put into a scrollpane (see Adding A Table To A Container). If you put a table directly into a panel, the headers won't appear (although you can extract the table header and display it separately).

  3. #3
    pratim is offline Member
    Join Date
    Mar 2011
    Posts
    8
    Rep Power
    0

    Default

    Sir, actually i could not able to give row headers separately. I am facing problem at this point only. From the database Can you provide a simple example explaining this. I have to give row headers separately, but the row values must have to be taken from the database only.

    Thank you for your reply.

  4. #4
    dlorde is offline Senior Member
    Join Date
    Jun 2008
    Posts
    339
    Rep Power
    7

    Default

    I'm afraid I don't understand your difficulty.

  5. #5
    pratim is offline Member
    Join Date
    Mar 2011
    Posts
    8
    Rep Power
    0

    Default

    Sorry sir, probably i could not able to explain my problem fully. Actually my question is that how to give row headers separately??? The column names should be taking from the database.

    Now, I need to display all the values corresponding to a particular row and a particular column from the database and not hardcoded.

    Whether i could explain you properly now?

    Thank you for paying your attention.

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default

    Check out camickr's Table from database/.

    db

  7. #7
    pratim is offline Member
    Join Date
    Mar 2011
    Posts
    8
    Rep Power
    0

    Default

    Thank you sir for your reply. You have given your valuable time. Now i will continue further....

    Thank you once again.

Similar Threads

  1. problem regarding giving value to string variable
    By enggvijaysingh@gmail.com in forum Advanced Java
    Replies: 3
    Last Post: 12-17-2010, 10:11 PM
  2. JTable with multiple Header
    By bircastri in forum AWT / Swing
    Replies: 1
    Last Post: 11-15-2010, 11:26 AM
  3. DisplayTag Table header styling problem and paging
    By selvi in forum Web Frameworks
    Replies: 0
    Last Post: 08-05-2010, 08:14 AM
  4. Replies: 1
    Last Post: 07-28-2010, 03:46 PM
  5. header of jtable
    By bbq in forum AWT / Swing
    Replies: 1
    Last Post: 07-05-2007, 04:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •