harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Elena Sayapina (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-4429) [classlib][awt] FocusTraversalPolicy.getInitialComponent(new Frame("Frame")) returns null on Harmony and non-null value on RI
Date Thu, 12 Jul 2007 06:39:04 GMT
[classlib][awt] FocusTraversalPolicy.getInitialComponent(new Frame("Frame")) returns null on
Harmony and non-null value on RI
-----------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-4429
                 URL: https://issues.apache.org/jira/browse/HARMONY-4429
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Elena Sayapina
            Priority: Minor


FocusTraversalPolicy.getInitialComponent(new Frame("Frame")) returns null on Harmony and non-null
value on RI

Please, consider the following code:

import java.awt.AWTEvent;
import java.awt.Component;
import java.awt.Container;
import java.awt.FocusTraversalPolicy;
import java.awt.Frame;
import java.awt.KeyboardFocusManager;
import java.awt.event.KeyEvent;

public class keyboardTest {

	public static void main(String[] args) {
	        TestKeyboardFocusManager manager = new TestKeyboardFocusManager();
                              FocusTraversalPolicy policy = manager.getDefaultFocusTraversalPolicy();
                              System.out.println("InitialComponent: " + policy.getInitialComponent(new
Frame("Frame")));
	}
}

class TestKeyboardFocusManager extends KeyboardFocusManager {

    public boolean getMyProperty() {
        return false;
    }

    public boolean dispatchEvent(AWTEvent arg0) {
        return false;
    }

    protected void dequeueKeyEvents(long arg0, Component arg1) {
    }

    protected void enqueueKeyEvents(long arg0, Component arg1) {
    }

    protected void discardKeyEvents(Component arg0) {
    }

    public void focusNextComponent(Component arg0) {
    }

    public void focusPreviousComponent(Component arg0) {
    }

    public void upFocusCycle(Component arg0) {
    }

    public void downFocusCycle(Container arg0) {
    }

    public boolean dispatchKeyEvent(KeyEvent arg0) {
        return false;
    }

    public boolean postProcessKeyEvent(KeyEvent arg0) {
        return false;
    }

    public void processKeyEvent(Component arg0, KeyEvent arg1) {
    }
}

Output on Harmony-r555176:

Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors,
as applicable.
java version "1.5.0"
pre-alpha : not complete or compatible
svn = r555176, (Jul 11 2007), Windows/ia32/msvc 1310, release build
http://harmony.apache.org

InitialComponent: null


Output on RI:

java version "1.5.0_11"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)

InitialComponent: java.awt.Frame[frame0,0,0,0x0,invalid,hidden,layout=java.awt.BorderLayout,title=Frame,resizable,normal]


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message