Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict resizing Inner Frames to the available area #362

Closed
lukeu opened this issue Jul 27, 2021 · 1 comment
Closed

Restrict resizing Inner Frames to the available area #362

lukeu opened this issue Jul 27, 2021 · 1 comment
Milestone

Comments

@lukeu
Copy link

lukeu commented Jul 27, 2021

When resizing an inner frame of a JDesktopPane, Metal and Windows L&Fs both restrict the resize operation (whilst dragging) to avoid resizing it out of the available area.

In contrast, FlatLaF allows the inner window to be resized outside of the visible area, potentially making the title and resize controls inaccessible, such that the user cannot bring the inner frame back into full view.

The 3 L&Fs can be tested using this simple example:

import java.awt.BorderLayout;
import javax.swing.*;
import com.formdev.flatlaf.FlatLightLaf;

public class TestFrames {

    public static void main(String[] args) {
        SwingUtilities.invokeLater(() -> new TestFrames().show());
    }

    private void show() {
//        FlatLightLaf.setup();

//        try {
//            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName().toString());
//        } catch (Exception e) {
//            throw new RuntimeException(e);
//        }

        var desktop = new JDesktopPane();
        desktop.setVisible(true);

        var frame = new JInternalFrame("frame", true, true, true, true);
        frame.setSize(400,300);
        frame.setVisible(true);
        frame.setResizable(true);
        desktop.add(frame);

        var window = new JFrame();
        window.setSize(800, 600);
        window.add(new JToolBar() {{ add(new JMenuItem("Boo")); }}, BorderLayout.NORTH);
        window.add(desktop);
        window.setLocationRelativeTo(null);
        window.setVisible(true);
    }
}
DevCharly added a commit that referenced this issue Jul 29, 2021
…; honor maximum size of internal frame (issue #362)
@DevCharly
Copy link
Collaborator

Thanks, fixed in main branch.

A snapshot is available here: https://github.com/JFormDesigner/FlatLaf#snapshots

@DevCharly DevCharly added this to the 1.5 milestone Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants