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

Demo: add responsive layout #4

Merged
merged 8 commits into from
Jul 14, 2024
Merged

Demo: add responsive layout #4

merged 8 commits into from
Jul 14, 2024

Conversation

DJ-Raven
Copy link
Owner

This PR add responsive layout to demo project.

Example

// create jpanel
JPanel panel = new JPanel();

// set item size (-1 for use component preferred size)
Dimension itemSize = new Dimension(-1, -1);

// create responsive layout and set to jpanel
panel.setLayout(new ResponsiveLayout(ResponsiveLayout.JustifyContent.FIT_CONTENT, itemSize));

// add component to panel
panel.add(component);

Full responsive layout constructor

ResponsiveLayout(JustifyContent justifyContent, Dimension size, int horizontalGap, int verticalGap, int column)

Justify content

public enum JustifyContent {
    START, END, CENTER, SPACE_BETWEEN, SPACE_AROUND, SPACE_EVENLY, FIT_CONTENT
}

Demo form

2024-07-14_160444

2024-07-14_160340

@DJ-Raven DJ-Raven merged commit 26f9d2a into main Jul 14, 2024
@DJ-Raven DJ-Raven deleted the responsive-layout branch July 16, 2024 11:03
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

Successfully merging this pull request may close these issues.

1 participant