User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 456,597 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,423 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 10650 | Replies: 44
Reply
Join Date: Mar 2007
Posts: 25
Reputation: dkdeleon68 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
dkdeleon68 dkdeleon68 is offline Offline
Light Poster

Re: Inventory program part 5 help

  #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  
Join Date: Sep 2007
Posts: 1
Reputation: Thallon is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Thallon Thallon is offline Offline
Newbie Poster

Re: Inventory program part 5 help

  #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  
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,630
Reputation: peter_budo is just really nice peter_budo is just really nice peter_budo is just really nice peter_budo is just really nice 
Rep Power: 12
Solved Threads: 311
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is online now Online
Code tags enforcer

Re: Inventory program part 5 help

  #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, JAVAWUG (Java Web User Group), Coding the Architecture
Reply With Quote  
Join Date: Oct 2007
Posts: 1
Reputation: inuyasha_kagome is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
inuyasha_kagome inuyasha_kagome is offline Offline
Newbie Poster

Re: Inventory program part 5 help

  #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  
Join Date: May 2007
Location: USA
Posts: 3,090
Reputation: Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold 
Rep Power: 15
Solved Threads: 307
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Posting Sensei

Re: Inventory program part 5 help

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Java Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Java Forum

All times are GMT -4. The time now is 6:57 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC