1

I am converting a medium-size (13892 LOC) Java Swing application into an applet.

So far, I've got the applet running and showing both in the Applet Viewer (via Eclipse) and showing in the browser (tested with Chrome and Firefox).

However, no click events are being registered by the application. Neither for JMenuItem, JButton, etc.

The general structure of the app is the following

public class MainWindow extends  JInternalFrame implements ActionListener { 
 ...
    private JToolBar toolBar;
    private JButton btnOpen;
 ...
    toolBar = new JToolBar();
    getContentPane().add(toolBar, BorderLayout.NORTH);
    btnOpen = new JButton("Open");
    btnOpen.addActionListener(this);
    toolBar.add(btnOpen);
 ...
    @Override
    public void actionPerformed(ActionEvent event) {
            btnOpen.setText("ACTION PERFORMED");
    if (event.getSource().equals(btnOpen)) {
        btnOpen_clicked();
    }       
    private void btnOpen_clicked() {
       btnOpen.setText(btnOpen.getText()+"/YAY!");
    }
}

Any clue on why would this happen?

Roman C
  • 49,761
  • 33
  • 66
  • 176
obaqueiro
  • 982
  • 12
  • 29
  • 2
    *"I am converting a medium-size (13892 LOC) Java Swing application into an applet."* Easier for us & better experience for the end user is to simply launch the application using [Java Web Start](http://stackoverflow.com/tags/java-web-start/info). – Andrew Thompson Nov 17 '12 at 02:29
  • Unfortunately, part of the migration consists on interacting with the container webpage (for example, replacing the console output). – obaqueiro Nov 17 '12 at 02:46
  • What the.. Why is a Swing application putting anything to the *console?* That will definitely need to be fixed before doing anything, and what advantage then remains for the applet form? – Andrew Thompson Nov 17 '12 at 02:54
  • Perhaps a [_hybrid_](http://stackoverflow.com/a/12449949/230513) would offer some flexibility? See also [*Initial Threads*](http://docs.oracle.com/javase/tutorial/uiswing/concurrency/initial.html), required for both. `JInternalFrame` is usually used in a `JDesktopPane`. – trashgod Nov 17 '12 at 03:32
  • It turns out it was a signing issue. The JAR file needed to be signed to get some needed permissions – obaqueiro Nov 17 '12 at 06:20

0 Answers0