root / trunk / libraries / libUIComponent / src-test-ui / org / gvsig / gui / beans / datainput / TestDataInput.java @ 11445
History | View | Annotate | Download (1.39 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 |
import org.gvsig.gui.beans.datainput.DataInputContainer; |
11 |
|
12 |
public class TestDataInput implements ComponentListener { |
13 |
private int w = 150, h = 50; |
14 |
private JFrame frame = new JFrame(); |
15 |
private DataInputContainer data = null; |
16 |
|
17 |
public TestDataInput(){
|
18 |
JPanel p = new JPanel(); |
19 |
p.setSize(w, h); |
20 |
|
21 |
data = new DataInputContainer(50); |
22 |
frame.addComponentListener(this);
|
23 |
p.add(data, null);
|
24 |
|
25 |
frame.getContentPane().add(p); |
26 |
frame.setSize(w, h); |
27 |
frame.setVisible(true);
|
28 |
frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); |
29 |
} |
30 |
|
31 |
public static void main(String[] args) { |
32 |
try {
|
33 |
UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel"); |
34 |
} catch (Exception e) { |
35 |
System.err.println("No se puede cambiar al LookAndFeel"); |
36 |
} |
37 |
|
38 |
new TestDataInput();
|
39 |
} |
40 |
|
41 |
public void componentResized(ComponentEvent e) { |
42 |
data.setComponentSize(frame.getWidth() - 10, frame.getHeight() - 30); |
43 |
} |
44 |
|
45 |
public void componentHidden(ComponentEvent e) { |
46 |
// TODO Auto-generated method stub
|
47 |
} |
48 |
|
49 |
public void componentMoved(ComponentEvent e) { |
50 |
// TODO Auto-generated method stub
|
51 |
} |
52 |
|
53 |
public void componentShown(ComponentEvent e) { |
54 |
// TODO Auto-generated method stub
|
55 |
} |
56 |
} |