Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6594219

Plugin loads Swing classes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 7
    • 6, 6u10, 7
    • deploy
    • b64
    • generic, x86
    • generic, windows_xp

        Java plugin loads many Swing classes even if the applet does not use Swing, and Java console is off.

        I configured plugin to run hprof (-Xrunhprof:heap=dump), and set 'Do not start console' in Advanced/Java console. Though my applet was AWT-only, 66 Swing classes were loaded - see attached hprof.txt.

        I used Firefox2 and JDK 7 b17 on Linux, and the following applet:

        import java.applet.Applet;
        import java.awt.*;
        import java.awt.event.WindowAdapter;
        import java.awt.event.WindowEvent;

        public class T extends Applet {
            public void start() {
                final Frame f = new Frame("100% AWT");
                f.add(new Button("Hit me if you can!"));
                f.addWindowListener(new WindowAdapter() {
                    public void windowClosing(WindowEvent ev) {
                        System.out.println("Exiting!");
                        f.setVisible(false);
                        f.dispose();
                    }
                });
                
                f.pack();
                f.setVisible(true);
            }
        }

              herrick Andy Herrick (Inactive)
              peterz Peter Zhelezniakov
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: