You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The resize listener for JFrame is not working properly, because it is called at
the end of an resize event (and not continously while resizing).
Solution:
The ComponentListener (ComponentAdapter) has to be added to the ContentPane of
the JFrame. This Listener will only receive resize events, because the
ContentPane will never be moved relative to the JFrame.
Suggestion:
// in SwingComponent
final Component resizeListenerComponent; // may be replaced by method
if (getUiReference() instanceof JFrame) {
resizeListenerComponent = ((JFrame) getUiReference()).getContentPane();
}
else {
resizeListenerComponent = getUiReference();
}
resizeListenerComponent.addComponentListener(new ComponentAdapter() {
@Override
public void componentResized(final ComponentEvent e) {
componentObservable.fireSizeChanged();
}
});
getUiReference().addComponentListener(new ComponentAdapter() {
@Override
public void componentMoved(final ComponentEvent e) {
componentObservable.firePositionChanged();
}
});
Original issue reported on code.google.com by googlec...@dev.nikolaus-moll.de on 22 Apr 2011 at 1:29
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
googlec...@dev.nikolaus-moll.de
on 22 Apr 2011 at 1:29The text was updated successfully, but these errors were encountered: