Statistics
| Revision:

root / trunk / libraries / libUIComponent_praster / src-test / org / gvsig / gui / beans / dataInput / TestDataInput.java @ 8026

History | View | Annotate | Download (1.47 KB)

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

    
3
import java.awt.event.ComponentEvent;
4
import java.awt.event.ComponentListener;
5

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

    
10
public class TestDataInput implements ComponentListener {
11
        private int                                                w = 150, h = 50;
12
        private JFrame                                        frame = new JFrame();
13
        private DataInputContainer                data = null;
14
        
15
        public TestDataInput(){
16
                JPanel p = new JPanel();
17
                p.setSize(w, h);
18
                                
19
                data = new DataInputContainer(50);
20
                frame.addComponentListener(this);
21
                p.add(data, null);
22
                
23
                frame.getContentPane().add(p);
24
                frame.setSize(w, h);
25
                frame.setVisible(true);
26
                
27
        }
28
        
29
        public static void main(String[] args){
30
                try {
31
                          UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
32
                          //UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel");
33
                          //UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
34
            } catch( Exception e ) {
35
                  System.err.println( "No se puede cambiar al LookAndFeel");
36
            }
37
                TestDataInput tof = new TestDataInput();
38
        }
39

    
40
        public void componentHidden(ComponentEvent e) {
41
                // TODO Auto-generated method stub
42
                
43
        }
44

    
45
        public void componentMoved(ComponentEvent e) {
46
                // TODO Auto-generated method stub
47
                
48
        }
49

    
50
        public void componentResized(ComponentEvent e) {
51
                data.setComponentSize(frame.getWidth() - 10, frame.getHeight() - 30);
52
                
53
        }
54

    
55
        public void componentShown(ComponentEvent e) {
56
                // TODO Auto-generated method stub
57
                
58
        }
59
}