codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Jtable  t00018645 at 16:59 on Monday, March 21, 2005
 

hi there, im new to the site and was just wondering if someone could please help me. Working on a project which sells carparts. Have connected to my sql database, i am retrieving information and populating 4 comboboxes with it. I have a seperate clickhandler class for each text box, so that when the user selects something from the combobox, it should populate a row in the table, ie:combobox 1 will fill row 1, combobox2 will fill row 2 etc. However the problem im getting is that when i select something from combox1, it goes to the table fine, however when i select something from combobox 2, it goes into row 2, but i loose what i had in row1. Can anyone help me? I know i have a problem with creating a new table in every class, tried to alter this by bringing back the table from every class with info stored in it, ie: jable1.getModel();. Any help would be apreciated.


first combobox:
jTable1.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{rs.getString(1), rs.getString(2), rs.getString(3), rs.getString(4)},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"ProductId", "ItemName", "Descriptin", "Cost"
}
));

second comboBox
jTable1.getModel (javax.swing.table.DefaultTableModel(
new Object [][] {
{jTable1.getModel},
{rs.getString(1), rs.getString(2), rs.getString(3), rs.getString(4)},
{null, null, null, null},
{null, null, null, null}
}








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: Shopping Cart -
•  Shopping cart
•  Altering Text Fields,
•  how to set up the project in vc ++ for the class with container member data?
•  new guy looking for simple stub app
•  in vc++ 5.0, get a lot of errors when compile, like, C2501: `string` : missing decl-specifiers etc.
•  Re: Zip/Unzip using Asp.Net without using any third party controls.
•  Jtable
•  Newbie Help!


Recent Articles
Communicating with the Database (Using ADO)
MagicGrid
Simple Thumbnail Browsing Solution
Type Anywhere
A Better Moustrap: FmtDate to replace FormatDateTime
ASP.NET Forum Source Code
Internal Search Engine
Javascript Growing Window
Simple date validation
Search engine friendly URLs using ASP.NET (C#.NET)


Site Survey
Help us serve you better. Take a five minute survey. Click here!

© Copyright codetoad.com 2001-2005