Code Monkey home page Code Monkey logo

java-swing-drawer's Introduction

java-swing-drawer

This drawer custom with animation and miglayout and show drawer on glassPane of jfram

Method

Builder Method Parameters Default Values
header Component optional
addChild List<Component> optional
addFooter List<Component> optional
space int optional
separator int , Color optional
background Color new Color(30, 30, 30)
drawerBackground Color Color.WHITE
backgroundTransparent float (0f to 1f) 0.5f
drawerWidth int 250
headerHeight int 150
duration int 500
resolution int 10
itemHeight int 45
closeOnPress boolean true
enableScroll boolean false
enableScrollUI boolean true
leftDrawer boolean true
itemAlignLeft boolean true
event EventDrawer optional
build none required

Example Build Drawer with jfram

drawer = Drawer.newDrawer(jfram)
        .background(new Color(90, 90, 90))
        .enableScroll(true)
        .header(new JLabel("Header"))
        .space(3)

        .addChild(new DrawerItem("User ").icon(new ImageIcon(getClass().getResource("/icon/user.png"))).build())
        .addChild(new DrawerItem("Contacts").icon(new ImageIcon(getClass().getResource("/icon/cont.png"))).build())

        .addFooter(new DrawerItem("Exit").icon(new ImageIcon(getClass().getResource("/icon/exit.png"))).build())

        .event(new EventDrawer() {
            @Override
            public void selected(int index, DrawerItem item) {
                if (drawer.isShow()) {
                    drawer.hide();
                }
                //  More code here
            }
        })
        .build();

Example how to show and hide drawer

if (drawer.isShow()) {
    drawer.hide();
} else {
    drawer.show();
}

Screenshot

2022-07-06_232302

java-swing-drawer's People

Contributors

dj-raven avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.