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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:35:21+00:00 2026-06-01T13:35:21+00:00

i have some code that i am trying to recompile and understand, but i

  • 0

i have some code that i am trying to recompile and understand, but i have a method that does not compile and i wish to find the good work around. the method is as follows.

private void launchEventPanel(String title) { 
    EventQueue.invokeLater(new Runnable(title) { 
        public void run() { 
        JFrame myFrame = new JFrame(); 
        myFrame.setTitle("Conference Call"); 
        myFrame.setIconImage(CallConference.this.myCore.myPanel.myIconManager.getPromptIcon(CallEMart.class.toString())); 
        myFrame.getContentPane().add(CallConference.this.myEventPanel, "Center"); 
        myFrame.pack(); 
        myFrame.setVisible(true); } }); }

the second line of the EventQueue.invokeLater does not compile, i get the error “Anonymous class implements interface, cannot have arguments”.

any help and work around is highly appreciated. thanks!

  • 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-01T13:35:23+00:00Added an answer on June 1, 2026 at 1:35 pm

    Well, as the message says: java.lang.Runnable is an interface so you cannot pass title to its constructor.
    Use:

    EventQueue.invokeLater(new Runnable() { 
    

    instead.

    Note that title isn’t used anywhere. If you need it inside the Runnable, you need to declare it final:

    private void launchEventPanel(final String title) { 
    EventQueue.invokeLater(new Runnable() { 
        public void run() { 
        JFrame myFrame = new JFrame(); 
        myFrame.setTitle(title); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying to implement unit testing and currently have some code that does
I have some legacy C++ code that I am trying to understand a bit
I have some code that performs a deep copy using Object.clone, but I'm trying
Trying to get comfortable with jQuery and I have encountered some sample code that
I am trying to setup a few fixes in some code that have caught
I have a mobile platform that I am trying to write some communications code
I have some code(client side) that is trying to cache responses from a web
I have some functional code that I'm trying to speed up by eliminating the
I have some test code that i'm just trying to use to figure out
I have some mutable scala code that I am trying to rewrite in a

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.