Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8105545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:11:34+00:00 2026-06-06T00:11:34+00:00

Ok – I have the following code – on the starred part I get

  • 0

Ok – I have the following code – on the starred part I get errors. The ItemManager class requires that I fill the () with Items. However when I do I get the error that Items cannot be resolved to a variable and I am unsure of how to fix that.

package presentation;
import javax.swing.*;

import business.ItemManager;

import java.awt.*;
import java.awt.event.*;
import business.*;

public class CreateInventoryUI extends JFrame {

    private static final long serialVersionUID = -3940805393905465307L;
    private JButton addBtn = new JButton ("Add Item to Inventory");
    private JButton showBtn = new JButton ("Display Inventory");

    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                    CreateInventoryUI frame = new CreateInventoryUI("Inventory");
                    frame.setVisible(true);
                } catch (Exception e) {
                    e.printStackTrace();
                    System.out.println("Exception - Sorry");
                }
            }
        });
    }


    public CreateInventoryUI(String name) { // title bar name
        super(name);

        // layout here
        Container container = getContentPane();
        FlowLayout layout = new FlowLayout();
        container.setLayout(layout);
        layout.setAlignment(FlowLayout.CENTER);
        container.add(new JButton("Display inventory"));
        container.add(new JButton("Add Item to Inventory"));


        addBtn.addActionListener (new ActionListener() {
            public void actionPerformed (ActionEvent event) {
                // controller code
                ***ItemManager mngr = new ItemManager();
                mngr.store(Items);***
            }
        });



        showBtn.addActionListener (new ActionListener() {
            public void actionPerformed (ActionEvent event) {
                // controller code
                ItemManager mngr = new ItemManager();
                mngr.get(Items);
            }
        });

        setDefaultCloseOperation(EXIT_ON_CLOSE);
        pack();
        setVisible(true);
    }


    /**
     * Constructs a <code>String</code> with all attributes
     * in name = value format.
     *
     * @return a <code>String</code> representation 
     * of this object.
     */
    public String toString()
    {
        final String TAB = "    ";

        String retValue = "";

        retValue = "CreateInventoryUI ( "
            + super.toString() + TAB
            + "addBtn = " + this.addBtn + TAB
            + "showBtn = " + this.showBtn + TAB
            + " )";

        return retValue;
    }


}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T00:11:36+00:00Added an answer on June 6, 2026 at 12:11 am

    You are passing Items to mngr.store but you do not have Items declared anywhere. [Also, by convention class names begin with a capital and variables begin with a lowercase, so you probably want the variable to be named items, which is of type Items]

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a webpage that will be viewed by mainly IE users, so CSS3 is
i have a text file with the following data: Calculated Concentrations 30.55 73.48 298.25
I have a simple restful service that transforms a JAXB-anntotated beans to response XML
i have this code: <?php $valid_ext = array(pdf, doc); $args = array( 'post_type' =>
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a PHP application that stores PHP datetime to my MySQL table. I
So to start, I have an array of XML files. These files need to
I've got the following login script.. <?php $name = $_POST[name]; $password = $_POST[password]; $query
My NSXMLParser breaks on this string: <title>AAA &#8211; BCDEFGQWERTYUIO</title> I parsed it in this
I need a function that will clean a strings' special characters. I do NOT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.