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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:01:13+00:00 2026-06-03T15:01:13+00:00

I have the following problem. I have a small form with a button (we’re

  • 0

I have the following problem. I have a small form with a button (we’re talking about JAVA here), which sends the data in the form trough a socket-connection with the server. Now, when i press the button, it’s making this single connection, but in the meanwhile, the button remains ‘pressed’, if you get me. After the action, activated by the actionlistener, has been completed (made connection, sent data, closed connection) the button get released.

Now my question is, is there a simple fix for that, and if so (or not), how can i fix this?

Thanks in advance.

submit.addActionListener(this);

And this is the part, but i hope that was made clear in the text.

public void actionPerformed(ActionEvent ae) {
        if (ae.getSource() == submit) {
            boodschap = testtext.getText();
//            System.out.println(boodschap);
            try {
                try {
                    UserConnection connect = new UserConnection(boodschap);
                } catch (SQLException ex) {
                    Logger.getLogger(UserAction.class.getName()).log(Level.SEVERE, null, ex);
                }
            } catch (ClassNotFoundException ex) {
                Logger.getLogger(UserAction.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
}

(oh, this code works like a charm. There’s nothing wrong with the code, it’s just displayed to give you an indication of what i mean.)

  • 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-03T15:01:14+00:00Added an answer on June 3, 2026 at 3:01 pm

    The problem is that you are doing a long-running operation on the UI thread. If you put your code into a SwingWorker or even into a Runnable and run it in a new thread it should resolve your problem

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

Sidebar

Related Questions

I have a small problem here. When I tried to do the following steps,
I am building a small prototype, and have the following problem: I am trying
I have following problem: in my layout xml I have relative layout in which
I have the following problem which ripped my soul for the past 2 weeks:
I'm having a small problem with mod_rewrite I have the following in my .htacces:
We have following problem. Developers frequently need to make small changes to our web
I have another small problem with centering elements. I thought about the previous questions
I have following problem. I have a team page like this example: http://www.social-markets.de/social-commerce-team.html small
I have the following problem: I want to send a type (java.lang.Class) over the
I have a small problem in html forms. When I give the following css,

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.