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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:36:09+00:00 2026-06-06T12:36:09+00:00

I wrote an application that generates quiz applets. I could’t find a portable way

  • 0

I wrote an application that generates quiz applets. I could’t find a portable way to sign the generated applets automatically so they are not signed. But this simple piece of code as far as I know doesn’t require the Applet to be signed, yet it is throwing accessControlException about “accessEventQueue” on linux.
I’m running it on IceTea7, OpenJDK7, I tried on both Chrome and Opera.

System.out.println("This will display...");

int r = JOptionPane.showConfirmDialog(null,"End the quiz now?",
    "Quiz",
    JOptionPane.YES_NO_OPTION,                  
    JOptionPane.INFORMATION_MESSAGE);

System.out.println("This won't...");

Surfing a little I found this info about a bug on IcedTea.
I’ve tried the applet myself on windows and it isn’t throwing any Exception there.

If what I’ve found is really a bug, is there any workaround or I’ll have to implement my own confirmation dialog…?

Is there any way to popup a JOptionPane dialog without interfering with the AWT event queue?

  • 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-06T12:36:11+00:00Added an answer on June 6, 2026 at 12:36 pm

    As I heard from the developers, it’s an actual bug.

    Here’s my naive implementation of a confirmation dialog to save you some coding time:

    public class ConfirmDialog implements ActionListener {
        JFrame main;
        ConfirmCallback callback;
    
        public ConfirmDialog(String msg,String[] opts, ConfirmCallback lc) {
            this(msg,"Selection",opts,lc);
        }
    
        public ConfirmDialog(String msg,String title ,String[] opts,  ConfirmCallback lc) {
            main = new JFrame();
            main.setTitle(title);
            this.callback = lc;
            main.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
            GridBagConstraints gbc = new GridBagConstraints();
            GridBagLayout layout = new GridBagLayout();
    
            JPanel panel = new JPanel();
            panel.setLayout(layout);
            panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
            gbc.fill = GridBagConstraints.HORIZONTAL;
            gbc.gridx = 0; gbc.gridy =0;
            gbc.gridwidth = opts.length; gbc.gridheight = 1;
            gbc.insets = new Insets(3,3,3,3);
    
            JLabel mainLabel = new JLabel(msg);
    
            layout.setConstraints(mainLabel, gbc);
            panel.add(mainLabel);
    
            gbc.gridy = 1;
            gbc.gridwidth= 1;
    
            int cnt = 0;
            for (String s: opts) {
                JButton submitButton = new JButton(s);
                submitButton.setActionCommand(Integer.toString(cnt++));
                submitButton.addActionListener(this);   
                gbc.gridx = cnt;
                layout.setConstraints(submitButton, gbc);
                panel.add(submitButton);
            }
            main.add(panel);
            main.pack();
            main.setLocationRelativeTo(null);
            main.setVisible(true);
    
        }
    
        public ConfirmDialog() {}
    
        @Override
        public void actionPerformed(ActionEvent e) {
            callback.run(Integer.decode(e.getActionCommand()));
            main.dispose();
        }
    
        public void Test() {
            ConfirmCallback cb = new ConfirmCallback(){
                @Override
                public void run(int arg) {
                    JOptionPane.showMessageDialog(null, "The user just entered: "+arg);
                }
            };
            new ConfirmDialog("Please choose",new String[] {"a","b","c"},cb);
        }
    
        public static void main(String args[]) {
            new ConfirmDialog().Test();
        }
    }
    

    And here is the callback it uses:

    public abstract class ConfirmCallback {
        public abstract void run(int arg);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a quiz web application that is dynamically generated from a database on
I wrote an application that re-hosts the Workflow 4 Designer (System.Activities.Presentation.WorkflowDesigner). Activities are discovered
I have wrote an application that syncs two folders together. The problem with the
I wrote a C# application that is a simple countdown timer. I use it
I have got a Wavecom Supreme GSM modem. I wrote a simple application that
I wrote an application in JAVA that adds articles to a Joomla site. My
(Using WPF) In a small application that I wrote, I am using some count-down
I have a process that currently runs in a Delphi application that I wrote
I keep getting the error in VS 2100 CRT detected that the application wrote
I'm VERY new to Linq. I have an application I wrote that is 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.