Resizing Jpanel grid columns

Resizing Jpanel grid columns

I'm wondering if it is possible to resize Jpanels, I've been searching for a while but haven't found what I'm looking for.

I'm wondering if it is possible to resize Jpanels, I've been searching for a while but haven't found what I'm looking for.

This is my code:

    JFrame frame = new JFrame("My Frame");
    JPanel panel = new JPanel(new GridLayout(1,2)); // split the panel in 1 rows and 2 cols

panel.add(new PixelPanel());
panel.add(new MyPanel());

frame.getContentPane().add(panel);

frame.setVisible(true);
frame.setSize(1920, 1080);

This creates a layout with the 2 columns next to eachother with a border exactly in the middle seperating the 2 Jpanels.A lot of software nowadays offers the user an option to resize the width of the 2 panels. So by grabbing the border and pulling it to the left or right 1 panel will grow larger and the other one will slink down. Is there any build in feature for this? And if not, would it be better to build this behavior onto Jpanel, or would it be better to make custom panel system?

Thank you in advance!

(if the behavior im after isnt clear, I could make a gif explaining it)

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Java Fundamentals: Learn Java for absolute beginners |Simpliv

Java Fundamentals: Learn Java for absolute beginners

Java Essentials : Learn Core Java From Basic to Advance

Learn Java Programming Using Practical Assignments. Start Building Back-end Web Applications Robust Test Automation Frameworks By End Of The Course. Learn More!

Fundamentos de Java: Aprende Java desde cero, sin misterios | Simpliv

Fundamentos de Java: Aprende Java desde cero, sin misterios