void (MouseEvent event) { if (event.isConsumed()) return; if (BUTTON1_MASK == (BUTTON1_MASK & event.getModifiers()) && 1 < event.getClickCount()) { Component view = getView(getContent(event)); if (view instanceof Frame frame) { int state = frame.getExtendedState(); if (!isStateSet(Frame.ICONIFIED, state) && frame.isResizable()) { event.consume(); frame.setExtendedState(isStateSet(Frame.MAXIMIZED_BOTH, state) ? (state & ~Frame.MAXIMIZED_BOTH) : (state | Frame.MAXIMIZED_BOTH)); } } } super.mouseClicked(event); }