Inventory program part 5 help

Reply

Join Date: Mar 2007
Posts: 25
Reputation: dkdeleon68 is an unknown quantity at this point 
Solved Threads: 0
dkdeleon68 dkdeleon68 is offline Offline
Light Poster

Re: Inventory program part 5 help

 
0
  #41
Sep 17th, 2007
I would like to thank Ezzaral and peter_budo for helping me bettter understand java. I learned more from you guys in just a short time than I did from my class and instructor.
Thank you very much.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1
Reputation: Thallon is an unknown quantity at this point 
Solved Threads: 0
Thallon Thallon is offline Offline
Newbie Poster

Re: Inventory program part 5 help

 
0
  #42
Sep 24th, 2007
I tried to run this code as written

Correction... I tried to compile the code as written

I got a ".\ActionListener.java: class, interface, or enum expected" for every single line of code.

That makes no sense! I have tried to reveiw the tutorials on ActionListener and its implementation but I'm having trouble connecting the dots.

Is there a significant change from Java 1.4 to the 1.5 and beyond. I think I have JDK suite installed on my CPU.

or is there a gap in the program I just missed or is 'assumed' and just not written in.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,190
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 483
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Inventory program part 5 help

 
0
  #43
Sep 24th, 2007
Yes there lots of differences between this two versions. However you should speed up as there is Java 1.6 aviable over a year already
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1
Reputation: inuyasha_kagome is an unknown quantity at this point 
Solved Threads: 0
inuyasha_kagome inuyasha_kagome is offline Offline
Newbie Poster

Re: Inventory program part 5 help

 
0
  #44
Oct 7th, 2007
I am also doing inventoy program 5 but my issue is that i have an double array.
an honestly i can think of a way to get the info to diplay one at a time because of this. i dont know if i would be better of swiching to a singal array or if i can do a if loop some how.

this is what i have so far if someone could point me in the right way that would be great because im not get much help from my teach.

import java.awt.*;
import javax.swing.*;



public class iteminventory7

{

/** Creates a new instance of StoreItemInventory */

public static void main (String[] args)

{

double Game[][] = { { 1550, 100, 230.5, 0 },
{ 1552, 110, 220.5, 0 },
{ 1553, 10, 120.5, 0 },
{ 1554, 200, 20.75, 0 },
{ 1555, 130, 20.35, 0 },
{ 1556, 120, 22.5, 0 },
{ 1557, 100, 50.5, 0 },
{ 1558, 111, 40.5, 0 },
{ 1559, 220, 30.5, 0 },
{ 1560, 133, 20.5, 0 },
{ 1561, 1220, 10.5, 0 } };

iteminventory myGame = new iteminventory( "Items","Out of this World !!!", Game );
myGame.displaymessage();
myGame.outputitems();
}


public static class iteminventory
{
/** Creates a new instance of iteminventory */
private String storeName;
private String itemName;
private double Game[][];
private double Itemvalue;
private int UnitAmount;
private double Restockfee;



public iteminventory(String name, String Sname, double GameArray[][])
{
storeName = Sname;
itemName = name;
Game = GameArray;
}


public String getstoreName()
{
return storeName;
}


//displays main message
public void displaymessage()
{
System.out.printf( "Welcome to our Store : %s!\n", getstoreName());
}


// method returning itemname
public String getitemName()
{
return itemName;
}


// method setting itemname
public void setitemName(String name, int index)
{
itemName = name;
}


//performs the various operations on the item inventory info
public double gettotal(int atcount )
{
double total = 0.0; // initialize total
// sum inventory average
total = (Game[atcount][1]) * (Game[atcount][2]);
return total;
}

//prints out a listing of the item information

public double getRestockfee(int atcount )
{
double total2 = 0.0; // sum inventory average
total2 = (Game[atcount][1]) * (Game[atcount][2] * 0.05);
return total2;
}



//prints out a listing of the item information
public void outputitems()
{

Labels mylabels = new Labels(); // create Labels
mylabels.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
mylabels.setSize(535, 480); // set frame size
mylabels.setVisible( true ); // display frame

}




public class Labels extends JFrame
{

private JLabel itemNameLabel;
private JLabel itemNumberLabel;
private JLabel UnitAmountLabel;
private JLabel ItemvalueLabel;
private JLabel InventoryvalueLabel;
private JLabel RestockingfeeLabel;
private JLabel totalInventoryValueLabel;
private JFrame frame = new JFrame();
private TextArea text = new TextArea();
//frame.getContentPane();add(BorderLayout.WEST, JLabels);



// Labels constructor adds JLabels to JFrame
public Labels()
{
super( "Inventory Program" );
setLayout( new FlowLayout() ); // set frame layout

// JLabel constructor
text.setSize(50,485);
itemNameLabel = new JLabel("Name: ");
itemNameLabel.setToolTipText("Name Label ");
add( itemNameLabel ); // add bookTitleLabel to JFrame
itemNumberLabel = new JLabel("Item Number: ");
itemNumberLabel.setToolTipText("Item Number Label ");
add( itemNumberLabel ); // add itemNumberLabel to JFrame
UnitAmountLabel = new JLabel("UnitAmount: ");
UnitAmountLabel.setToolTipText("UnitAmount Label");
add( UnitAmountLabel ); // add bookUnitsLabel to JFrame
ItemvalueLabel = new JLabel("Item Price: ");
ItemvalueLabel.setToolTipText("Item Price Label");
add( ItemvalueLabel ); // add bookPriceLabel to JFrame
InventoryvalueLabel = new JLabel("Inventory Value: ");
InventoryvalueLabel.setToolTipText("Inventory Value Label");
add ( InventoryvalueLabel ); // add inventoryValueLabel to JFrame
RestockingfeeLabel = new JLabel("Restocking Fee: ");
RestockingfeeLabel.setToolTipText("Restocking Fee Label");
add( RestockingfeeLabel ); // add bookRestockingFeeLabel to JFrame
add(text);
text.setText(getstoreName());
} // end Label constructor

} // end class Labels
}
}

I know how to do a button for a single array button I so lost Im on my 7th file trying to figure out how to do this with a double array. I know im making this a lot harder then it real is but i think my brain stop working somewhere along the 5 file. well tell me what you guys think if its a lose or if i can use so type of loop. i think an if and a else loop would work or if i would just be better off going with a single array

thanks for the help and if it seems like im asking for code im sorry im not the best at wording this type of stuff.
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,439
Reputation: Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of 
Solved Threads: 510
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: Inventory program part 5 help

 
0
  #45
Oct 8th, 2007
Originally Posted by inuyasha_kagome View Post
I am also doing inventoy program 5 but my issue is that i have an double array.
an honestly i can think of a way to get the info to diplay one at a time because of this. i dont know if i would be better of swiching to a singal array or if i can do a if loop some how.
...<snipped>
Please post questions as a new thread and be sure to place code tags around all code that is posted. See the announcement at the top of the forum if you do not know how to use the code tags. Also, the coding conventions published by Sun are worth a read http://java.sun.com/docs/codeconv/ht...nvTOC.doc.html.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC