Example usage for java.awt.event HierarchyEvent consume

List of usage examples for java.awt.event HierarchyEvent consume

Introduction

In this page you can find the example usage for java.awt.event HierarchyEvent consume.

Prototype

protected void consume() 

Source Link

Document

Consumes this event, if this event can be consumed.

Usage

From source file:com.all.browser.impl.MozillaBrowser.java

private void registerListeners() {
    mozillaPanel.addHierarchyBoundsListener(new HierarchyBoundsAdapter() {
        @Override// w  w  w  . j av a 2s.c  om
        public void ancestorResized(HierarchyEvent e) {
            Container changedParent = e.getChangedParent();
            if (changedParent != null) {
                mozillaPanel.setBounds(changedParent.getBounds());
            }
        }
    });

    mozillaPanel.addKeyListener(new KeyAdapter() {
        @Override
        public void keyPressed(KeyEvent e) {
            int keyCode = e.getKeyCode();
            if (keyCode == KeyEvent.VK_SPACE) {
                e.consume();
            }
        }
    });
}