Results 1 to 9 of 9
  1. #1
    Pieter is offline Member
    Join Date
    Jul 2010
    Location
    Melkbosstrand
    Posts
    4
    Rep Power
    0

    Default Add or remove a row on a jtable with Netbeans 6.0

    Hello people. Im as using Netbeans 6.0. I created a form with a few combo boxes, radio buttons, labels, button, and a jtable. What im doing is im reading data out of a table in mysql and then i populate the jtable with the data. How it works is the person selects one of the 3 radio buttons, then they click on button to view the results for that selected option. The problem comes in when a long list is being (the "Year" option is selected)displayed and the person chooses another option that brings back a shorter list(the "Week" option is selected). Then the long list remains in the table. Could anyone please help me with a solution?

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,429
    Rep Power
    7

    Default

    Tough. How did you implement your TableModel?
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    Pieter is offline Member
    Join Date
    Jul 2010
    Location
    Melkbosstrand
    Posts
    4
    Rep Power
    0

    Default Implement TableModel

    I selected it from netbeans component palette. And I set the Table contents settings as user specified.

  4. #4
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,429
    Rep Power
    7

    Default

    There is a TableModel in the netbeans component palette?!
    I suggest you read this tutorial: How to Use Tables (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  5. #5
    Pieter is offline Member
    Join Date
    Jul 2010
    Location
    Melkbosstrand
    Posts
    4
    Rep Power
    0

    Default Implement TableModel

    I will go through the tutorial. Thank you for your help.

  6. #6
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,429
    Rep Power
    7

    Default

    You're welcome. Post back if you get stuck.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  7. #7
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,641
    Rep Power
    7

  8. #8
    Pieter is offline Member
    Join Date
    Jul 2010
    Location
    Melkbosstrand
    Posts
    4
    Rep Power
    0

    Default Add or remove a row on a jtable with Netbeans 6.0

    Thank you for your help I found my problem
    tblall.setModel(new javax.swing.table.DefaultTableModel(columnNames, total));
    With the same project I want to be able to open one frame with a button on another frame could you please point me in the right direction.

  9. #9
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by Pieter View Post
    With the same project I want to be able to open one frame with a button on another frame could you please point me in the right direction.
    Assuming that you've gone through the tutorials on how to use JButtons and how to create JFrames (although here I'd consider using a JDialog or switching views with CardLayout), we're all better off knowing what you've tried and what doesn't work.

    Much luck!

Similar Threads

  1. JTable netbeans help
    By karno in forum NetBeans
    Replies: 1
    Last Post: 03-31-2010, 04:45 AM
  2. Populating JTable with 2 arrays (Netbeans)
    By althair in forum AWT / Swing
    Replies: 3
    Last Post: 12-30-2009, 03:05 PM
  3. Netbeans JTable
    By sysout in forum NetBeans
    Replies: 6
    Last Post: 08-26-2009, 03:27 AM
  4. Replies: 3
    Last Post: 03-09-2009, 08:37 AM
  5. Netbeans Jtable
    By Manfizy in forum NetBeans
    Replies: 16
    Last Post: 11-13-2008, 10:15 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
  •