Package com.explodingpixels.macwidgets

Source Code of com.explodingpixels.macwidgets.DImageButton

package com.explodingpixels.macwidgets;

import com.explodingpixels.widgets.ImageButton;

import javax.swing.*;
import java.awt.*;

public class DImageButton {

    public static void main(String[] args) {

        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                Icon icon = new ImageIcon(
                        DImageButton.class.getResource("/com/explodingpixels/macwidgets/icons/scroller.png"));
                Icon pressedIcon = new ImageIcon(
                        DImageButton.class.getResource("/com/explodingpixels/macwidgets/icons/scroller_pressed.png"));
                Icon mask = new ImageIcon(
                        DImageButton.class.getResource("/com/explodingpixels/macwidgets/icons/scroller_mask.png"));

                ImageButton button = new ImageButton(icon, mask);
                button.setPressedIcon(pressedIcon);

                JFrame frame = new JFrame();
                frame.add(button, BorderLayout.CENTER);
                frame.setSize(150, 100);
                frame.setLocationRelativeTo(null);
                frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                frame.setVisible(true);
            }
        });
    }
}
TOP

Related Classes of com.explodingpixels.macwidgets.DImageButton

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.