User Profile

Collapse

Profile Sidebar

Collapse
Freckles
Freckles
Last Activity: May 31 '07, 06:18 PM
Joined: May 23 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Here's what I added but I can still see it's wrong. Do I need to call each item[ ] ... and how do I do that if so?

    Code:
     
    public class InventoryGui extends JFrame //begin class InventoryGui
    {
    private JLabel items; // JLabel with just text 
    public InventoryGui()
    {
    setLayout( new FlowLayout() );
    items = new JLabel("text");
    add(items);
    }
    public static void main( String
    ...
    See more | Go to post

    Leave a comment:


  • Thanks for the tips. I still haven't been able to get the 2-decimal point to work. But I've moved on to bigger and better and things for the moment.... I just have to make my items show up in a frame one at a time, which I've managed to figure out. But I want the entire application to close when I finish going through each window. I'm trying to use EXIT_ON_CLOSE, but it's not working properly. Can anyone tell me what I'm missing? This assignment...
    See more | Go to post

    Leave a comment:


  • Perfect - Thank you!! Is there anywhere that I can put in the %.2f argument to keep my restock fee to 2 decimal places? I've tried putting it in several places, but end up either having it print or with an error....
    See more | Go to post

    Leave a comment:


  • I added this plus the additional information, but now I'm getting a new error ...

    Code:
    class Plastic extends Product
    {
    	private String itemColor; //color of product
    
    	public Plastic () //begin constructor
    	{
    		super();
    		itemColor = "";
    	}
    
    	public Plastic ( int itemNumber, String itemName, int stock, double price, String itemColor )
    	{
    		super.toString();
    ...
    See more | Go to post

    Leave a comment:


  • I feel so dumb when it comes to this stuff! How do I call the toString from the Product class into the Plastic class?...
    See more | Go to post

    Leave a comment:


  • Thanks Jos. That fixed my output errors, but it's not printing the additional attribute (color) or restock fee that's in my "Plastic" class. How do I link the two up so everything prints?...
    See more | Go to post

    Leave a comment:


  • I tried this and it didn't help. I'm still getting the same output except now with the option
    for the user to enter a choice. Any other suggestions?...
    See more | Go to post

    Leave a comment:


  • You guys are super ... thanks - that worked! My program compiles now, but it's not giving me the correct ouput. This is what I get rather than a list of inventory items with their respective details:

    [LProduct;@42e81 6

    [LProduct;@42e81 6

    [LProduct;@42e81 6

    [LProduct;@42e81 6

    The Value of all items combined is: $45.96
    Press any key to continue . . . .

    Any...
    See more | Go to post

    Leave a comment:


  • Freckles
    started a topic arguments don't match datatype of constructor
    in Java

    arguments don't match datatype of constructor

    Hi! I've been trying to get my inventory program to compile, but haven't had any luck. My instructor tells me that my arguments in the Inventory3 class need to match the datatype of the constructor in my Product class. I'm sure this is something rather simple that I should be able to figure out, but I'm at my wits end trying to make this work. Does anyone have any suggestions? My code is below. Thanks so much to anyone with advice in advance!!...
    See more | Go to post
No activity results to display
Show More
Working...