Problems with adding data to GUI

Data from Array into GUI Text Fields

Page 1 of 1

2 Replies - 1078 Views - Last Post: 11 November 2007 - 04:28 PM Rate Topic: -----

#1 Ealdwulf  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 11-November 07

Problems with adding data to GUI

Posted 11 November 2007 - 04:17 PM

Greetings,

I have been lurking for a while now, and have been able to utilize the information that I have found in order to accomplish everything up to the point that I am currently at.

I have searched the net, this forum, several different books on Java, and even tried a converter program from VB to Java (that was a joke in itself), and am finally at the point where I am needing to ask for assistance.

First the background. This is the rather infamous/notorious inventory program that has been seen in this forum for some time now. I am working on the section where I am displaying the program in a GUI interface. I wrote the program in VB and was able to get it to work, but unfortunately I have not been able to get it to display the data from the array in the GUI. Everything else seems to work fine and code to that point works like it is supposed to. I have to admit I used NetBeans 5.5.1 to build the GUI interface and have from there been populating the appropriate code.

If I could figure out how to get the data to populate into the GUI initially I believe that it would be relatively easy to take it from there and have it cycle through until all the data has been displayed. I have tried using both Vector and Array and although I believe that Vector would be better suited (and my preferred choice) I have had no luck with it and hence have used an Array.

Since I am not sure exactly where or what all would be needed, I have included all my code for this project. I am not asking others to do the work, but if someone could point me in the correct direction I would definitely appreciate any and all assistance on this.

InventoryPt4
// API Calls
	 import java.io.*;
	 import java.util.*;
	 import java.lang.*;
	 import javax.swing.*;

public class InventoryPt4 extends javax.swing.JFrame {

	/** Creates new form InventoryPt4 */
	public InventoryPt4() {
		initComponents();
	}

	/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
	// <editor-fold defaultstate="collapsed" desc=" Generated Code ">
	private void initComponents() {
		jLabel9 = new javax.swing.JLabel();
		cmdBtn_First = new javax.swing.JButton();
		cmdBtn_Back = new javax.swing.JButton();
		cmdBtn_Next = new javax.swing.JButton();
		cmdBtn_Last = new javax.swing.JButton();
		cmdBtn_Search = new javax.swing.JButton();
		cmdBtn_Add = new javax.swing.JButton();
		cmdBtn_Delete = new javax.swing.JButton();
		cmdBtn_Modify = new javax.swing.JButton();
		cmdBtn_Save = new javax.swing.JButton();
		jLabel1 = new javax.swing.JLabel();
		jLabel2 = new javax.swing.JLabel();
		jLabel3 = new javax.swing.JLabel();
		jLabel4 = new javax.swing.JLabel();
		jLabel5 = new javax.swing.JLabel();
		txtBox_SKU = new javax.swing.JTextField();
		txtBox_SoftwareTitle = new javax.swing.JTextField();
		txtBox_Platform = new javax.swing.JTextField();
		txtBox_Quantity = new javax.swing.JTextField();
		txtBox_UnitPrice = new javax.swing.JTextField();
		jLabel6 = new javax.swing.JLabel();
		jLabel7 = new javax.swing.JLabel();
		txtBox_RestockFee = new javax.swing.JTextField();
		txtBox_StockValue = new javax.swing.JTextField();
		jLabel8 = new javax.swing.JLabel();
		txtBox_CombinedValue = new javax.swing.JTextField();
		menuBar = new javax.swing.JMenuBar();
		fileMenu = new javax.swing.JMenu();
		exitMenuItem = new javax.swing.JMenuItem();
		helpMenu = new javax.swing.JMenu();
		aboutMenuItem = new javax.swing.JMenuItem();

		setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
		setTitle("Software Inventory Program");
		setName("InventoryFrame");
		jLabel9.setIcon(new javax.swing.ImageIcon("D:\\programming\\Inventory\\Logo_(150x150).jpg"));
		jLabel9.setToolTipText("Company Logo");
		jLabel9.setVisible(false);

		cmdBtn_First.setText("|<<");
		cmdBtn_First.setEnabled(false);
		cmdBtn_First.setVisible(false);
		cmdBtn_First.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				cmdBtn_FirstActionPerformed(evt);
			}
		});

		cmdBtn_Back.setText("<");
		cmdBtn_Back.setEnabled(false);
		cmdBtn_Back.setVisible(false);
		cmdBtn_Back.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				cmdBtn_BackActionPerformed(evt);
			}
		});

		cmdBtn_Next.setText(">");
		cmdBtn_Next.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				cmdBtn_NextActionPerformed(evt);
			}
		});

		cmdBtn_Last.setText(">>|");
		cmdBtn_Last.setEnabled(false);
		cmdBtn_Last.setVisible(false);
		cmdBtn_Last.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				cmdBtn_LastActionPerformed(evt);
			}
		});

		cmdBtn_Search.setText("Search");
		cmdBtn_Search.setEnabled(false);
		cmdBtn_Search.setVisible(false);
		cmdBtn_Search.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				cmdBtn_SearchActionPerformed(evt);
			}
		});

		cmdBtn_Add.setText("Add");
		cmdBtn_Add.setEnabled(false);
		cmdBtn_Add.setVisible(false);
		cmdBtn_Add.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				cmdBtn_AddActionPerformed(evt);
			}
		});

		cmdBtn_Delete.setText("Delete");
		cmdBtn_Delete.setEnabled(false);
		cmdBtn_Delete.setVisible(false);
		cmdBtn_Delete.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				cmdBtn_DeleteActionPerformed(evt);
			}
		});

		cmdBtn_Modify.setText("Modify");
		cmdBtn_Modify.setEnabled(false);
		cmdBtn_Modify.setVisible(false);
		cmdBtn_Modify.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				cmdBtn_ModifyActionPerformed(evt);
			}
		});

		cmdBtn_Save.setText("Save");
		cmdBtn_Save.setEnabled(false);
		cmdBtn_Save.setVisible(false);
		cmdBtn_Save.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				cmdBtn_SaveActionPerformed(evt);
			}
		});

		jLabel1.setFont(new java.awt.Font("Tahoma", 1, 12));
		jLabel1.setText("Product Number");

		jLabel2.setFont(new java.awt.Font("Tahoma", 1, 12));
		jLabel2.setText("Software Title");

		jLabel3.setFont(new java.awt.Font("Tahoma", 1, 12));
		jLabel3.setText("Operating System");

		jLabel4.setFont(new java.awt.Font("Tahoma", 1, 12));
		jLabel4.setText("Quantity in Stock");

		jLabel5.setFont(new java.awt.Font("Tahoma", 1, 12));
		jLabel5.setText("Unit Price");

		txtBox_SKU.setFont(new java.awt.Font("Tahoma", 0, 12));

		txtBox_SoftwareTitle.setFont(new java.awt.Font("Tahoma", 0, 12));

		txtBox_Platform.setFont(new java.awt.Font("Tahoma", 0, 12));

		txtBox_Quantity.setFont(new java.awt.Font("Tahoma", 0, 12));

		txtBox_UnitPrice.setFont(new java.awt.Font("Tahoma", 0, 12));

		jLabel6.setFont(new java.awt.Font("Tahoma", 1, 12));
		jLabel6.setText("Restocking Fee");

		jLabel7.setFont(new java.awt.Font("Tahoma", 1, 12));
		jLabel7.setText("Inventory Value");

		txtBox_RestockFee.setEditable(false);
		txtBox_RestockFee.setBackground(new java.awt.Color(255, 255, 255));
		txtBox_RestockFee.setFont(new java.awt.Font("Tahoma", 0, 12));

		txtBox_StockValue.setEditable(false);
		txtBox_StockValue.setBackground(new java.awt.Color(255, 255, 255));
		txtBox_StockValue.setFont(new java.awt.Font("Tahoma", 0, 12));

		jLabel8.setFont(new java.awt.Font("Tahoma", 1, 12));
		jLabel8.setText("Total Value of Inventory");

		txtBox_CombinedValue.setEditable(false);
		txtBox_CombinedValue.setBackground(new java.awt.Color(255, 255, 255));
		txtBox_CombinedValue.setFont(new java.awt.Font("Tahoma", 0, 12));

		menuBar.setFont(new java.awt.Font("Tahoma", 0, 12));
		fileMenu.setText("File");
		fileMenu.setFont(new java.awt.Font("Tahoma", 0, 12));
		exitMenuItem.setText("Exit");
		exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				exitMenuItemActionPerformed(evt);
			}
		});

		fileMenu.add(exitMenuItem);

		menuBar.add(fileMenu);

		helpMenu.setText("Help");
		helpMenu.setFont(new java.awt.Font("Tahoma", 0, 12));
		aboutMenuItem.setText("About");
		aboutMenuItem.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				aboutMenuItemActionPerformed(evt);
			}
		});

		helpMenu.add(aboutMenuItem);

		menuBar.add(helpMenu);

		setJMenuBar(menuBar);

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(
			layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
			.addGroup(layout.createSequentialGroup()
				.addContainerGap()
				.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
					.addGroup(layout.createSequentialGroup()
						.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
							.addGroup(layout.createSequentialGroup()
								.addComponent(cmdBtn_First, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
								.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
								.addComponent(cmdBtn_Back, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE))
							.addComponent(jLabel1)
							.addComponent(jLabel2)
							.addComponent(jLabel3)
							.addComponent(jLabel4)
							.addComponent(jLabel5)
							.addComponent(jLabel6)
							.addComponent(jLabel7))
						.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
						.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
							.addGroup(layout.createSequentialGroup()
								.addComponent(txtBox_SoftwareTitle, javax.swing.GroupLayout.PREFERRED_SIZE, 349, javax.swing.GroupLayout.PREFERRED_SIZE)
								.addContainerGap(187, Short.MAX_VALUE))
							.addGroup(layout.createSequentialGroup()
								.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
									.addComponent(txtBox_Platform, javax.swing.GroupLayout.Alignment.LEADING)
									.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
										.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
											.addComponent(txtBox_StockValue, javax.swing.GroupLayout.Alignment.LEADING)
											.addComponent(txtBox_SKU, javax.swing.GroupLayout.Alignment.LEADING)
											.addComponent(cmdBtn_Next, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 70, Short.MAX_VALUE)
											.addComponent(txtBox_Quantity, javax.swing.GroupLayout.Alignment.LEADING)
											.addComponent(txtBox_UnitPrice, javax.swing.GroupLayout.Alignment.LEADING)
											.addComponent(txtBox_RestockFee, javax.swing.GroupLayout.Alignment.LEADING))
										.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(cmdBtn_Last, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)))
								.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
								.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
									.addGroup(layout.createSequentialGroup()
										.addComponent(cmdBtn_Search, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(cmdBtn_Add, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(cmdBtn_Delete, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(cmdBtn_Modify, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE))
									.addGroup(layout.createSequentialGroup()
										.addComponent(jLabel8)
										.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(txtBox_CombinedValue, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)))
								.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
								.addComponent(cmdBtn_Save, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
								.addContainerGap())))
					.addComponent(jLabel9, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE)))
		);
		layout.setVerticalGroup(
			layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
			.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
				.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
					.addGroup(layout.createSequentialGroup()
						.addContainerGap()
						.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
							.addComponent(jLabel1)
							.addComponent(txtBox_SKU, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
						.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
						.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
							.addComponent(jLabel2)
							.addComponent(txtBox_SoftwareTitle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
						.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
						.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
							.addComponent(jLabel3)
							.addComponent(txtBox_Platform, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
						.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
						.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
							.addComponent(jLabel4)
							.addComponent(txtBox_Quantity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
						.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
						.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
							.addComponent(jLabel5)
							.addComponent(txtBox_UnitPrice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
						.addGap(27, 27, 27)
						.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
							.addComponent(jLabel6)
							.addComponent(txtBox_RestockFee, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
					.addComponent(jLabel9))
				.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
				.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
					.addComponent(jLabel7)
					.addComponent(txtBox_StockValue, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
					.addComponent(jLabel8)
					.addComponent(txtBox_CombinedValue, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
				.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
				.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
					.addComponent(cmdBtn_First)
					.addComponent(cmdBtn_Back)
					.addComponent(cmdBtn_Next)
					.addComponent(cmdBtn_Last)
					.addComponent(cmdBtn_Search)
					.addComponent(cmdBtn_Add)
					.addComponent(cmdBtn_Delete)
					.addComponent(cmdBtn_Modify)
					.addComponent(cmdBtn_Save))
				.addContainerGap())
		);
		pack();
	}// </editor-fold>

	private void cmdBtn_SaveActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
	}

	private void cmdBtn_ModifyActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
	}

	private void cmdBtn_DeleteActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
	}

	private void cmdBtn_AddActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
	}

	private void cmdBtn_SearchActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
	}

	private void cmdBtn_LastActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
	}

	private void cmdBtn_FirstActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
	}

	private void cmdBtn_BackActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
	}

	private void cmdBtn_NextActionPerformed(java.awt.event.ActionEvent evt) {
		// Debug Code
			System.exit(0);
	}

	private void aboutMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aboutMenuItemActionPerformed
		// Open a second form that provides information about the program
//			 AboutDialogue abtDlg = new AboutDialogue(parent);
		// using message dialog until I can get the opening of a second form to work
			JOptionPane.showMessageDialog(null, "Inventory Program Part 4\nby Ealdwulf");
	}//GEN-LAST:event_aboutMenuItemActionPerformed

	private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitMenuItemActionPerformed
		System.exit(0);
	}//GEN-LAST:event_exitMenuItemActionPerformed

	/**
	 * @param args the command line arguments
	 */
	public static void main(String args[])
	{
		java.awt.EventQueue.invokeLater(new Runnable()
		{
			public void run()
			{
				new InventoryPt4().setVisible(true);
			}
		});
			   // Initial Object Creation
					Scanner input = new Scanner( System.in );

			   // Variable declarations
					// Public
						 int int_itemSKU;
						 String str_productName = null;
						 String str_osPlatform = null;
						 int int_unitQty;
						 double dbl_unitCost;
						 double dbl_stockValue;
						 int int_stockQty;
						 int loopCount_Array;

					// Private

					// Arrays
						 Software[] array_inventoryList = new Software[5];
							  array_inventoryList[0] = new Software("Microsoft Office 2007 Professional", "Windows", 1001, 1, 499.95);
							  array_inventoryList[1] = new Software("Microsoft Windows XP Home SP2", "Windows", 1002, 2, 214.95);
							  array_inventoryList[2] = new Software("E-Frontier Poser 7", "Windows", 1003, 1, 249.99);
							  array_inventoryList[3] = new Software("DAZ3D Carrara 6 Professional", "Windows", 1004, 1, 549.00);
							  array_inventoryList[4] = new Software("DAZ3D Bryce 5.5", "Windows", 1005, 3, 69.95);
/*
						 Vector array_inventoryList = new Vector();
							  array_inventoryList.add("Microsoft Office 2007 Professional", "Windows", 1001, 1, 499.95);
							  array_inventoryList.add("Microsoft Windows XP Home SP2 OEM", "Windows", 1002, 2, 214.95);
							  array_inventoryList.add("E-Frontier Poser 7", "Windows", 1003, 1, 249.99);
							  array_inventoryList.add("DAZ3D Carrara 6 Professional", "Windows", 1004, 1, 549.00);
							  array_inventoryList.add("DAZ3D Bryce 5.5", "Windows", 1005, 3, 69.95);
*/

			   // Sort the array on the product name
					Arrays.sort(array_inventoryList);

			   // Calculate the total value of the stock
					dbl_stockValue = 0.0;
					dbl_stockValue = array_inventoryList[0].TotalStockValue(array_inventoryList);

			   // Display the values
//					 txtBox_SoftwareTitle.setText(array_inventoryList[0].getName());
					// Debug Code
						 System.out.printf("\n\t$%4.2f\n\t%s\n\n",dbl_stockValue,array_inventoryList[0].getName());
}

	// Variables declaration - do not modify
	private javax.swing.JMenuItem aboutMenuItem;
	private javax.swing.JButton cmdBtn_Add;
	private javax.swing.JButton cmdBtn_Back;
	private javax.swing.JButton cmdBtn_Delete;
	private javax.swing.JButton cmdBtn_First;
	private javax.swing.JButton cmdBtn_Last;
	private javax.swing.JButton cmdBtn_Modify;
	private javax.swing.JButton cmdBtn_Next;
	private javax.swing.JButton cmdBtn_Save;
	private javax.swing.JButton cmdBtn_Search;
	private javax.swing.JMenuItem exitMenuItem;
	private javax.swing.JMenu fileMenu;
	private javax.swing.JMenu helpMenu;
	private javax.swing.JLabel jLabel1;
	private javax.swing.JLabel jLabel2;
	private javax.swing.JLabel jLabel3;
	private javax.swing.JLabel jLabel4;
	private javax.swing.JLabel jLabel5;
	private javax.swing.JLabel jLabel6;
	private javax.swing.JLabel jLabel7;
	private javax.swing.JLabel jLabel8;
	private javax.swing.JLabel jLabel9;
	private javax.swing.JMenuBar menuBar;
	private javax.swing.JTextField txtBox_CombinedValue;
	private javax.swing.JTextField txtBox_Platform;
	private javax.swing.JTextField txtBox_Quantity;
	private javax.swing.JTextField txtBox_RestockFee;
	private javax.swing.JTextField txtBox_SKU;
	private javax.swing.JTextField txtBox_SoftwareTitle;
	private javax.swing.JTextField txtBox_StockValue;
	private javax.swing.JTextField txtBox_UnitPrice;
	// End of variables declaration

}


Product Class[code]// API Calls
import java.io.*;
import java.util.*;
import java.lang.*;

// Class object
public class Product implements Comparable
{
// Variable declarations
// Public

// Private variable declarations
private String str_name;
private int int_sku;
private int int_qty;
private double dbl_cost;
private double dbl_value;

// Arrays

// Constructors
// Default constructor
public Product()
{
str_name = "";
int_sku = 0;
int_qty = 0;
dbl_cost = 0.0;
}

// Initialization Constructor
public Product( String str_productName, int int_itemSKU, int int_unitQty, double dbl_unitCost )
{
this.str_name = str_productName;
this.int_sku = int_itemSKU;
this.int_qty = int_unitQty;
this.dbl_cost = dbl_unitCost;
}

// Methods
// Public access
// Return the name of the product
public String getName()
{
return str_name;
}

// Return the product ID
public int getSKU()
{
return int

This post has been edited by Ealdwulf: 11 November 2007 - 04:18 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Problems with adding data to GUI

#2 brawnyman713  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 139
  • Joined: 21-October 07

Re: Problems with adding data to GUI

Posted 11 November 2007 - 04:22 PM

Where in the code does is the array given to the program, and what is the name of the array?
Was This Post Helpful? 0
  • +
  • -

#3 Ealdwulf  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 11-November 07

Re: Problems with adding data to GUI

Posted 11 November 2007 - 04:28 PM

View Postbrawnyman713, on 11 Nov, 2007 - 04:22 PM, said:

Where in the code does is the array given to the program, and what is the name of the array?


The name of the array is array_inventoryList

As for where it is loaded into the program, that is towards the bottom of the InventoryPt4 code listing in the Main routine.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1