bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug swing/30577] New: StackOverflowException with extended DefaultDeskt


From: volker dot berlin at goebel-clan dot de
Subject: [Bug swing/30577] New: StackOverflowException with extended DefaultDesktopManager
Date: 24 Jan 2007 19:35:43 -0000

Hi,

The follow sample produce a StackOverflowException with the IKVM and run with
the Sun VM without problems. Of course this can be a bug in the IKVM but I
think this is a swing bug.

Volker Berlin


=========================
import java.awt.*;
import java.beans.PropertyVetoException;

import javax.swing.*;

public class Test extends JFrame{

    public static void main(String[] args) throws Exception{
        Test test = new Test();
    }

    JDesktopPane desktop = new JDesktopPane();

    Test() throws Exception{
        setContentPane(desktop);
        LocalBehaviour localbehaviour = new LocalBehaviour();
        desktop.setDesktopManager(localbehaviour);
        setSize(300,300);
        show();
        JInternalFrame frame = new JInternalFrame("Internal", true, true, true,
true);
        frame.pack();
        frame.setVisible(true);
        desktop.add(frame);

        Thread.sleep(100);
        frame.setSelected(true);

        Thread.sleep(100);
        frame.setSelected(false);
    }

    private class LocalBehaviour extends DefaultDesktopManager{

        public void activateFrame(JInternalFrame f) {
            super.activateFrame(f);
            if(!f.isSelected()) {
                // bad but this can happen from time to time. it should
                // be solved within the JDesktopPane/JInternalFrame
                // implementation
                try {
                    f.setSelected(true);
                } catch(PropertyVetoException ex) {
                    // this can be ignored, since the default implementation
                    // does so, too (extremely rare situation)
                }
            }
        }

        public void deactivateFrame(JInternalFrame f) {
            JInternalFrame[] frames = desktop.getAllFrames();
            if(frames.length == 1) {
                // in case there's only a single frame we won't
                // support deactivation
                if(desktop.getSelectedFrame() == null) {
                    desktop.setSelectedFrame(f);
                }
                if(!f.isSelected()) {
                    try {
                        f.setSelected(true);
                    } catch(PropertyVetoException ex) {
                        // this can be ignored, since the default
implementation
                        // does so, too (extremely rare situation)
                    }
                }
                return;
            }
            super.deactivateFrame(f);
        }
    }
}


-- 
           Summary: StackOverflowException with extended
                    DefaultDesktopManager
           Product: classpath
           Version: 0.93
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: swing
        AssignedTo: roman at kennke dot org
        ReportedBy: volker dot berlin at goebel-clan dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30577





reply via email to

[Prev in Thread] Current Thread [Next in Thread]