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 8201439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:48:55+00:00 2026-06-07T06:48:55+00:00

I’m working on a Java app in NetBeans for a friend. Here is the

  • 0

I’m working on a Java app in NetBeans for a friend. Here is the code:

public class ReportGenerator extends JFrame implements ActionListener {
//GUI components
private JMenuBar menuBar;
private JMenu fileMenu;
private JMenuItem newItem;
    private JMenuItem openItem;
    private JMenuItem exitItem;

private ReportGeneratorSetup setup;
private ReportGeneratorProgram application;

public ReportGenerator()
{
    menuBar = new JMenuBar();
    fileMenu = new JMenu("File");
    fileMenu.setMnemonic(KeyEvent.VK_F);
    exitItem = new JMenuItem("Exit");
    fileMenu.add(exitItem);
    exitItem.addActionListener(this);
    menuBar.add(fileMenu);
    this.setJMenuBar(menuBar);
    this.setSize(1000,1200);
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    this.setVisible(true);

    setup = new ReportGeneratorSetup(this);
    application = new ReportGeneratorProgram(this,setup);

    //this.add(setup);  
    this.validate();
}

public static void main(String[] args) {

    ReportGenerator rg = new ReportGenerator();
}  
public void switchToPanel(String panel)
{
    this.getContentPane().removeAll();

    if(panel.equals("Eval"))
    {
                    application.setupComponents();
        this.getContentPane().add(application);

    }
    else if(panel.equals("Setup"))
    {
        this.getContentPane().add(setup);
    }

    this.invalidate();
    this.validate();
}

@Override
public void actionPerformed(ActionEvent arg0)
{
    if(arg0.getSource() instanceof JMenuItem)
    {
        JMenuItem item = (JMenuItem)arg0.getSource();

        if(item.getText().equals("Exit"))
        {
            dispose();
            System.exit(0);
        }
    }
}

}

I am getting an error that says:

no suitable method found for add(reportgenerator.ReportGeneratorSetup)
    method java.awt.Container.add(java.awt.Component,java.lang.Object,int) is not applicable
      (actual and formal argument lists differ in length)
    method java.awt.Container.add(java.awt.Component,java.lang.Object) is not applicable
      (actual and formal argument lists differ in length)
    method java.awt.Container.add(java.awt.Component,int) is not applicable
      (actual and formal argument lists differ in length)
    method java.awt.Container.add(java.lang.String,java.awt.Component) is not applicable
      (actual and formal argument lists differ in length)
    method java.awt.Container.add(java.awt.Component) is not applicable
      (actual argument reportgenerator.ReportGeneratorSetup cannot be converted to java.awt.Component by method invocation conversion)
    method java.awt.Component.add(java.awt.PopupMenu) is not applicable
      (actual argument reportgenerator.ReportGeneratorSetup cannot be converted to java.awt.PopupMenu by method invocation conversion)

Can anyone tell me why this might be occurring? It would be greatly appreciated.

  • 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-07T06:48:57+00:00Added an answer on June 7, 2026 at 6:48 am

    Your class ReportGeneratorSetup needs to be some kind of component, most likely it needs to extend JPanel or JComponent.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have thousands of HTML files to process using Groovy/Java and I need to

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.