blob: 5b274220cfe4a075a294a41891590d988d046ab9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
package javax.swing.plaf.basic;
import javax.swing.plaf.*;
import javax.swing.*;
import java.awt.*;
public class BasicScrollPaneUI extends ScrollPaneUI
{
int min_w = 50;
int min_h = 50;
public static ComponentUI createUI(final JComponent c)
{
return new BasicScrollPaneUI();
}
public void installUI(final JComponent c)
{
super.installUI(c);
}
public Dimension getPreferredSize(JComponent c)
{
JScrollPane p = (JScrollPane ) c;
Dimension d = new Dimension(min_w,
min_h);
Dimension a = p.getViewport().getPreferredSize();
if (a != null)
{
d.width = Math.max(d.width, a.width);
d.height = Math.max(d.height, a.height);
}
System.out.println("BasicScrollPaneUI->preff->"+d);
return d;
}
void paint(Graphics g, JComponent c)
{
System.out.println("BasicScrollPaneUI->paint()->"+c);
JScrollPane p = (JScrollPane ) c;
p.getViewport().paint(g);
}
}
|