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

  • Home
  • SEARCH
  • 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 6194905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:22:29+00:00 2026-05-24T03:22:29+00:00

so I have a section of code that looks like this… public IPGUI() {

  • 0

so I have a section of code that looks like this…

public IPGUI() {
        setTitle("IP Extractor");
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setBounds(100, 100, 250, 300);
        contentPane = new JPanel();
        contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
        contentPane.setLayout(new BorderLayout(0, 0));
        setContentPane(contentPane);

        JPanel panel = new JPanel();
        contentPane.add(panel, BorderLayout.CENTER);
        panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));

        JButton btnConvertDocuments = new JButton("1. Convert Documents");
        btnConvertDocuments.setAlignmentX(Component.CENTER_ALIGNMENT);
        btnConvertDocuments.setMaximumSize(new Dimension(160, 0));
        btnConvertDocuments.setPreferredSize(new Dimension(0, 50));

        panel.add(btnConvertDocuments);
        btnConvertDocuments.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                //FileConverter fc = new FileConverter();
                            //Why wont the above method work?
            }
        });

        JSeparator separator_3 = new JSeparator();
        panel.add(separator_3);

When I click on the button, this is the error that is produced:

Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation problems: 
    FileConverter cannot be resolved to a type
    FileConverter cannot be resolved to a type

    at IPGUI$2.actionPerformed(IPGUI.java:60)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)

So I implemented the listener and the action performed event, but I don’t understand why I can’t make the call to that method in another class? Can someone explain where I am going wrong? Thank you in advance for any input.

  • 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-05-24T03:22:30+00:00Added an answer on May 24, 2026 at 3:22 am

    It appears you’re using Java Swing. Don’t forget to add “implements ActionListener” on the end of your class signature.

    Try this:

    public class IPGUI extends JFrame implements ActionListener {
    
    ...
    
    public IPGUI() {
            setTitle("IP Extractor");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setBounds(100, 100, 250, 300);
            contentPane = new JPanel();
            contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
            contentPane.setLayout(new BorderLayout(0, 0));
            setContentPane(contentPane);
    
            JPanel panel = new JPanel();
            contentPane.add(panel, BorderLayout.CENTER);
            panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
    
            JButton btnConvertDocuments = new JButton("1. Convert Documents");
            btnConvertDocuments.setAlignmentX(Component.CENTER_ALIGNMENT);
            btnConvertDocuments.setMaximumSize(new Dimension(160, 0));
            btnConvertDocuments.setPreferredSize(new Dimension(0, 50));
    
            panel.add(btnConvertDocuments);
            //btnConvertDocuments.addActionListener(new ActionListener() {
            //    public void actionPerformed(ActionEvent e) {
            //        //FileConverter fc = new FileConverter();
            //                    //Why wont the above method work?
            //    }
            //});
    
            btnConvertDocuments.setActionCommand("x");
            btnConvertDocuments.addActionListener(this);
    
            JSeparator separator_3 = new JSeparator();
            panel.add(separator_3);
    }
    
    public void actionPerformed(ActionEvent event) {
        String command = event.getActionCommand();
        if (command.equals("x")) {
            //FileConverter fc = new FileConverter();
        }
    }
    ...
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have legacy code that has cache implementation that looks like this: long lastUpadate;
I have a cookie that I use on my app. It looks like this:
I have an xml formatted document that looks like this: <?xml version=1.0 encoding=windows-1250?> <
For instance, I want to have a html form that looks like this: <table>
I am trying to extract a section of text that looks something like this:
I have an Entity class that looks like this: <?php namespace Entities; /** @Entity
So I have a base table that looks something like this. SELECT [BILL_MONTH] ,[BILL_YEAR]
I have a section of code that is being used to determine if a
I have a section of code that can be summarised as follows; void MyFunc()
I have the following section of code in an app that I am writing:

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.