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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:31:57+00:00 2026-06-04T16:31:57+00:00

My problem is as follows: I have a JApplet embedded into the HTML page

  • 0

My problem is as follows: I have a JApplet embedded into the HTML page and a form button with JS call of applet’s public method:

<input id="btnAppletSelectFiles" type="button" value="Select Files" 
    onclick="document.appletExcelUploader.SelectFiles();" />

in my JApplet I have FileChooser like:

public class ExcelUploader extends JApplet {

    private JFileChooser fc = new JFileChooser();
    // Some stuff
}

And I’m writing code like this in my applets’ public method:

  public void SelectFiles() {
        int retVal = fc.showOpenDialog(ControlsPanel.this);

        if (retVal == JFileChooser.APPROVE_OPTION) {
            for (File file : fc.getSelectedFiles()) {
                System.out.println(file.getName());
            }
        }
    }

And so when HTML button is clicked, File Dialog is shown normally, I can surf directories and check files, but I cannot press Open or OK button – I click it but dialog stays.

I think that I have a problem with threads – that I still somehow do this in “HTML and JS” Thread and not in my applets’ GUI thread or event dispatch thread.

How to fix the problem?

  • 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-04T16:31:58+00:00Added an answer on June 4, 2026 at 4:31 pm

    Methods in trusted applets that are called from JavaScript are no longer trusted because Java cannot account for all the code frames in the stack. To rectify the problem, use one of the AccessController.doPrivileged(..) overloaded methods.

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

Sidebar

Related Questions

all my problem is as follows: I have a page containing an addthis-button. Normally,
My problem is as follows. I have an array of objects in the form
Newbie here! My problem is as follows: I have a dynamically populating ul where
I have a mysql problem, my query looks as follows but not complete SELECT
A minimal code that reproduces the problem is as follows: <div class=cell> <input type=text
Greetings, I have a problem as follows: I have an SQL variable declared: DECLARE
My problem is as follows: I have server.properties for different environments. The path to
So my problem is as follows: I have 2 services running in different processes
Well, the problem is as follows: I have a WPF Application built using the
The problem is as follows: I have an HttpHander, which works completely fine in

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.