/** * Resize window frame to fit the content view of the currently selected tab. */ private void resize() { final NSRect windowFrame = NSWindow.contentRectForFrameRect_styleMask(window.frame(), window.styleMask()); final double height = this.getMinWindowHeight(); final NSRect frameRect = new NSRect( new NSPoint(windowFrame.origin.x.doubleValue(), windowFrame.origin.y.doubleValue() + windowFrame.size.height.doubleValue() - height), new NSSize(windowFrame.size.width.doubleValue(), height) ); window.setFrame_display_animate(NSWindow.frameRectForContentRect_styleMask(frameRect, window.styleMask()), true, window.isVisible()); }