Examples of BasicFrame


Examples of diva.gui.BasicFrame

                        sp.addShade("Foo", new JLabel("foo's component"));
                        sp.addShade("Bar", new JLabel("bar's component"));
                        sp.addShade("Baz", new JLabel("baz's component"));
                        sp.addShade("Moo", new JLabel("moo's component"));

                        JFrame f = new BasicFrame("Shade test");
                        f.getContentPane().add("Center", sp);

                        JPanel btns = new JPanel();
                        f.getContentPane().add("South", btns);

                        JButton b1 = new JButton("rm sel");
                        b1.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent e) {
                                int i = sp.getSelectedIndex();

                                if (i >= 0) {
                                    sp.removeShadeAt(i);
                                }
                            }
                        });
                        btns.add(b1);

                        JButton b2 = new JButton("rm sel-1");
                        b2.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent e) {
                                int i = sp.getSelectedIndex() - 1;

                                if (i >= 0) {
                                    sp.removeShadeAt(i);
                                }
                            }
                        });
                        btns.add(b2);

                        JButton b3 = new JButton("rm sel+1");
                        b3.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent e) {
                                int i = sp.getSelectedIndex() + 1;

                                if ((i >= 1) && (i < sp.getShadeCount())) {
                                    sp.removeShadeAt(i);
                                }
                            }
                        });
                        btns.add(b3);

                        JButton b4 = new JButton("rm all");
                        b4.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent e) {
                                sp.removeAll();
                            }
                        });
                        btns.add(b4);

                        JButton b5 = new JButton("toggle sel");
                        b5.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent e) {
                                int i = sp.getSelectedIndex();

                                if (i >= 0) {
                                    boolean en = sp.isEnabledAt(i);
                                    sp.setEnabledAt(i, !en);
                                }
                            }
                        });
                        btns.add(b5);

                        JButton b6 = new JButton("toggle sel-1");
                        b6.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent e) {
                                int i = sp.getSelectedIndex() - 1;

                                if (i >= 0) {
                                    boolean en = sp.isEnabledAt(i);
                                    sp.setEnabledAt(i, !en);
                                }
                            }
                        });
                        btns.add(b6);

                        f.setSize(600, 400);
                        f.setVisible(true);
                    } catch (Exception ex) {
                        System.err.println(ex.toString());
                        ex.printStackTrace();
                    }
                }
View Full Code Here

Examples of org.tools.ui.utils.BasicFrame

    /**
     *
     * @param title
     */
    public OggPlayerApp(String title) {
        JFrame frame = new BasicFrame(title);

        // icon
        frame.setIconImage(TestIOManager.getAsImage("/icons/app.icon.png"));

        // components
        JLabel label = new JLabel("Song");
        JProgressBar progress = new JProgressBar();
        JButton load = new JButton("Browse");
        JToggleButton play = new JToggleButton("Play");

        // layout
        frame.setLayout(new MigLayout("wrap 2"));
        frame.add(label, "wmin 200, sg a");
        frame.add(load, "sg b");
        frame.add(progress, "sg a");
        frame.add(play, "sg b");


        // pack and set visible
        frame.pack();
        frame.setVisible(true);
    }
View Full Code Here
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.