by AurelienRibon

AurelienRibon / sliding-layout

A powerful Java Swing panel/layout with cool transitions involving sliding subpanels

126 Stars 40 Forks Last release: Not found 19 Commits 4 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:


This little library lets you very easily create smooth transitions between two layouts of components in a special panel. The layouts are based on a grid, which can nest sub-grids and provides fixed/flexible columns and rows.

The library is fully documented (javadoc everywhere) to get you started quickly.

Note: The library uses the Universal Tween Engine under the hood, so you need to have this library in your classpath. It is compatible with the revision 6.3.3.


The following animated gif features an example of what can be done with the library.

There is also a Youtube video featuring the same demo with images. The source code of these examples is available in the demo folder of this project.


Please use the issue tracker of this repository to report a bug. Else, there is a dedicated forum for you if you need some help to understand how it works or how to setup your project :)


The library is distributed under the Apache-2 License. Feel free to modify it, distribute it and include it in your projects as you want.


General setup:

// First create the panel and give it a way to animate
// its transitions

SLPanel panel = new SLPanel(); panel.setTweenManager(SLAnimator.createTweenManager());

// Create your configurations

SLConfig config1 = ... ; SLConfig config2 = ... ;

// Then set the panel to its initial configuration


// Start the animation thread


// Now, whenever you want, you can fire a transition

panel.createTimeline() .push(new SLKeyframe(config2, 0.6f) .setEndSide(SLSide.BOTTOM, child1, child2) .setStartSide(SLSide.UP, child3, child4)) .play();

Creating a layout configuration is very simple (extracted from the demo):

SLConfig mainCfg = new SLConfig(panel)
    .gap(10, 10)
    .beginGrid(0, 0)
        .place(0, 0, p1)
        .place(1, 0, p2)
    .beginGrid(0, 1)
        .place(0, 0, p3)
        .place(1, 0, p4)
    .place(0, 2, p5);

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.