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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:39:21+00:00 2026-05-31T13:39:21+00:00

I have created a Java Swing application. Some users can’t connect to the internet

  • 0

I have created a Java Swing application. Some users can’t connect to the internet when activating the application, checking program updates, etc. because they are using a Proxy.

I have been reading about the interesting ProxySelector Class. It is very nice, but i have some questions about it please :

  1. Will this class detect all types of Proxies that can be used(HTTP, HTTPS, FTP, SOCK,…) ?

  2. If the Proxy used needs authentication, will this class get its information automatically ?

  3. I have written code to get the Proxy settings used. Now i need to test this but i do not have a proxy, so i was going to set a proxy like the instructions here, but is there a faster method ? Can i use Public Proxies to test this like hidemyass.com ?

  • 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-31T13:39:22+00:00Added an answer on May 31, 2026 at 1:39 pm

    I can’t answer all your questions, but here some of them:

    1.I belive that it will use the proxy selector for HTTP, HTTPS ans SOCKS. AFAIK, FTP is not natively supported by the JVM.

    2.For Authentication, you can use the following code:

    Authenticator.setDefault(new Authenticator() {
        private URL previous;
        int count = 0;
        @Override
        protected PasswordAuthentication getPasswordAuthentication() {
               try {
                   if (previous == getRequestingURL())
                       count++;
                   if (previous != getRequestingURL()) {
                       count = 0;
                   } else {
                        if (count<3) {
                             // Ask for login/passwd to the user
                        } else {
                            // Throw a RuntimeException to prevent locking the account
                            throw new TooManyFailedAttemptException();
                        }
    
                       return new PasswordAuthentication("login", "password".toCharArray());
                   }
              } finally {
                   previous = getRequestingURL();
              }
        }
    });
    

    3.I guess that any public proxy is ok. I am not really sure on how you are going to ensure that your code is actually using it. Personally I set up a Squid proxy which is not that hard and there you can really trace your calls.

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

Sidebar

Related Questions

I have a swing Java application that preserves a lot of data (you can
I have created one java-swing application. The application runs perfectly runs perfect on my
I have created in my Java Swing application a main window with a JButton.
I have an assignment to create a java Swing application to do some stuff
I have created a Java Swing application using JDK 1.6. Many customers are asking
I have created an executable java Swing .jar application. It works fine on Windows.
Some users of our Swing application have reported weird artefacts appearing on the display.
I would like to create extend a Java Swing application to have a look
I created a form using Swing in Java. In the form I have used
I have created a java application for Debian Linux. Now I want that that

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.