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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:57:37+00:00 2026-06-01T06:57:37+00:00

Here you have my switch from my Class Essaie with the Main() : switch(c)

  • 0

Here you have my switch from my Class Essaie with the Main() :

    switch(c)
    {
        case 0 :
                zero();
        break;
        case 1 :
                un();
        break;
        case 2 :
                deux();
        break;
        case 3 :
                trois();
        break;
        case 4 :
                quatre();
        break;
        case 5 :
                cinq();
        break;
        case 6 :
                six();
        break;
        case 7 :
                sept();
        break;
        case 8 :
                huit();
        break;
        case 9 :
                neuf();
        break;
        case 10 :
                dix();
        break;
        case 11 :
                onze();
        break;
        case 12 :
                douze();
        break;
        case 13 :
                exit = true;
        break;
        case 14 :
                quatorze(); //HELP
        default:
                System.out.println("\nEntrez un numero compris entre 1 et 13 (14 pour help)");
        break;

I would like to replace that with a simple frame that would call the same function using button to call them.

I’ve tried to create a class Windows and instantiate it in my main but i dont manage to link the action listener of the button of my Windows to the function in my class Essaie.

I’m sure that would be a lot easier to create the windows directly in the main and not use a class but i can’t get the trick, can anyone help me overcome this, or give me a sample of code to create button with action listener that would call those function?

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

    To create a button that calls zero() you can:

        JButton b0 = new JButton("0");
        b0.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e){
                zero();
            }
        });
    

    And you can add the button b0 to your JFrame. When the user clicks the button, the actionPerformed method is invoked and that will call your zero() method.

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

Sidebar

Related Questions

Ok here I have a switch case statement which is falling through and trying
Here i have gridview which contain some values retrieved from database.We put radiobutton list
Here is the scenario. I have a bunch of UserControls that all inherit from
I am trying to delete an entry from a database have been unsuccessful. Here
I have some trouble sending an Intent from a Service to an Activity. Here's
Just wondering what little scripts/programs people here have written that helps one with his
Since upgrading to 2008 I and many people here have noticed that randomly VS
Here,I have some Doubt with the output. Why the Output is same ? int
Here i have a message string that displays the content of an email. I
Here I have: Public Structure MyStruct Public Name as String Public Content as String

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.