Statistics
| Revision:

root / trunk / libraries / libUIComponent / src-test-ui / org / gvsig / gui / beans / doubleslider / TestDoubleSlider.java @ 11445

History | View | Annotate | Download (1.44 KB)

1
package org.gvsig.gui.beans.doubleslider;
2

    
3
import java.awt.BorderLayout;
4
import java.awt.Dimension;
5

    
6
import javax.swing.JFrame;
7
import javax.swing.JPanel;
8
import javax.swing.UIManager;
9

    
10
public class TestDoubleSlider {
11
        
12
        private JFrame jFrame = new JFrame();
13
        private DoubleSlider doubleSlider = null;
14
        private JPanel jPanel = null;
15

    
16
        public TestDoubleSlider() {
17
                jFrame = new JFrame();
18
                jFrame.getContentPane().setLayout(new BorderLayout());
19
                jFrame.setSize(new Dimension(498, 267));
20
                jFrame.setContentPane(getJPanel());
21
                jFrame.show();
22
                jFrame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
23
        }
24

    
25
        /**
26
         * This method initializes multiSlider        
27
         *         
28
         * @return borsanza.src.multislider.MultiSlider        
29
         */
30
        private DoubleSlider getMultiSlider() {
31
                if (doubleSlider == null) {
32
                        doubleSlider = new DoubleSlider();
33
                        doubleSlider.setMinimum(0);
34
                        doubleSlider.setMaximum(255);
35
                }
36
                return doubleSlider;
37
        }
38

    
39
        /**
40
         * This method initializes jPanel        
41
         *         
42
         * @return javax.swing.JPanel        
43
         */
44
        private JPanel getJPanel() {
45
                if (jPanel == null) {
46
                        jPanel = new JPanel();
47
                        jPanel.setLayout(new BorderLayout());
48
                        jPanel.add(getMultiSlider(), BorderLayout.CENTER);
49
                }
50
                return jPanel;
51
        }
52

    
53
        public static void main(String[] args) {
54
                try {
55
                        UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel");
56
                } catch (Exception e) {
57
                        System.err.println("No se puede cambiar al LookAndFeel");
58
                }
59
                new TestDoubleSlider();
60
        }
61
}
62