|
|
@@ -14,7 +14,7 @@ import javax.swing.JPanel;
|
|
14
|
14
|
|
|
15
|
15
|
public class FormValidationSwingDecorator extends AbstractFormValidationDecorator{
|
|
16
|
16
|
|
|
17
|
|
- private static final int POPUP_Y_OFFSET = 4;
|
|
|
17
|
+ private static final int POPUP_Y_OFFSET = 0;
|
|
18
|
18
|
private static final int POPUP_X_OFFSET = 12;
|
|
19
|
19
|
private Color oldColor = Color.WHITE;
|
|
20
|
20
|
private JFrame form;
|
|
|
@@ -31,7 +31,10 @@ public class FormValidationSwingDecorator extends AbstractFormValidationDecorato
|
|
31
|
31
|
glassPane.setLayout(null);
|
|
32
|
32
|
// glassPane.setPreferredSize(form.getPreferredSize());
|
|
33
|
33
|
glassPane.setSize(form.getSize());
|
|
|
34
|
+
|
|
34
|
35
|
form.setGlassPane(glassPane);
|
|
|
36
|
+
|
|
|
37
|
+
|
|
35
|
38
|
}
|
|
36
|
39
|
|
|
37
|
40
|
public FormValidationSwingDecorator(JFrame form, String message) {
|
|
|
@@ -48,6 +51,7 @@ public class FormValidationSwingDecorator extends AbstractFormValidationDecorato
|
|
48
|
51
|
} else {
|
|
49
|
52
|
popupPane = new JPanel(new FlowLayout());
|
|
50
|
53
|
glassPane.add(popupPane);
|
|
|
54
|
+ glassPane.setVisible(true);
|
|
51
|
55
|
|
|
52
|
56
|
popupPane.add(getIconLabel());
|
|
53
|
57
|
popupPane.add(getMessageLabel());
|
|
|
@@ -98,8 +102,9 @@ public class FormValidationSwingDecorator extends AbstractFormValidationDecorato
|
|
98
|
102
|
this.message = validator.getMessage();
|
|
99
|
103
|
this.oldColor = component.getBackground();
|
|
100
|
104
|
component.setBackground(Color.PINK);
|
|
101
|
|
- popups.put(component, createPopupRelativeTo(component));
|
|
102
|
|
- glassPane.setVisible(true);
|
|
|
105
|
+ JPanel panel = createPopupRelativeTo(component);
|
|
|
106
|
+ popups.put(component, panel);
|
|
|
107
|
+ panel.setVisible(true);
|
|
103
|
108
|
}
|
|
104
|
109
|
|
|
105
|
110
|
@Override
|
|
|
@@ -109,6 +114,5 @@ public class FormValidationSwingDecorator extends AbstractFormValidationDecorato
|
|
109
|
114
|
if (panel != null){
|
|
110
|
115
|
panel.setVisible(false);
|
|
111
|
116
|
}
|
|
112
|
|
- glassPane.setVisible(false);
|
|
113
|
117
|
}
|
|
114
|
118
|
}
|