@@ -77,20 +77,35 @@ public FindReplace(Editor editor) {
77
77
setResizable (false );
78
78
this .editor = editor ;
79
79
80
+
81
+ FlowLayout searchLayout = new FlowLayout (FlowLayout .RIGHT ,5 ,0 );
80
82
Container pain = getContentPane ();
81
- pain .setLayout (null );
83
+ pain .setLayout (searchLayout );
82
84
83
85
JLabel findLabel = new JLabel (_ ("Find:" ));
84
86
JLabel replaceLabel = new JLabel (_ ("Replace with:" ));
85
87
Dimension labelDimension = replaceLabel .getPreferredSize ();
88
+
89
+ JPanel find = new JPanel ();
86
90
87
- pain .add (findLabel );
88
- pain .add (replaceLabel );
91
+ find .add (findLabel );
92
+
93
+ find .add (findField = new JTextField (20 ));
94
+
95
+ pain .add (find );
96
+
97
+ JPanel replace = new JPanel ();
98
+
99
+ replace .add (replaceLabel );
89
100
90
- pain .add (findField = new JTextField (20 ));
91
- pain .add (replaceField = new JTextField (20 ));
101
+ replace .add (replaceField = new JTextField (20 ));
102
+
103
+ pain .add (replace );
104
+
92
105
int fieldHeight = findField .getPreferredSize ().height ;
93
106
107
+ JPanel checkbox = new JPanel ();
108
+
94
109
// Fill the findString with selected text if no previous value
95
110
if (editor .getSelectedText ()!=null && editor .getSelectedText ().length ()>0 )
96
111
findString = editor .getSelectedText ();
@@ -107,7 +122,7 @@ public void actionPerformed(ActionEvent e) {
107
122
}
108
123
});
109
124
ignoreCaseBox .setSelected (ignoreCase );
110
- pain .add (ignoreCaseBox );
125
+ checkbox .add (ignoreCaseBox );
111
126
112
127
wrapAroundBox = new JCheckBox (_ ("Wrap Around" ));
113
128
wrapAroundBox .addActionListener (new ActionListener () {
@@ -116,7 +131,7 @@ public void actionPerformed(ActionEvent e) {
116
131
}
117
132
});
118
133
wrapAroundBox .setSelected (wrapAround );
119
- pain .add (wrapAroundBox );
134
+ checkbox .add (wrapAroundBox );
120
135
121
136
searchAllFilesBox = new JCheckBox (_ ("Search all Sketch Tabs" ));
122
137
searchAllFilesBox .addActionListener (new ActionListener () {
@@ -125,11 +140,13 @@ public void actionPerformed(ActionEvent e) {
125
140
}
126
141
});
127
142
searchAllFilesBox .setSelected (searchAllFiles );
128
- pain .add (searchAllFilesBox );
143
+ checkbox .add (searchAllFilesBox );
129
144
145
+ pain .add (checkbox );
146
+
130
147
JPanel buttons = new JPanel ();
131
148
132
- buttons .setLayout (new FlowLayout (FlowLayout .CENTER ,BUTTONGAP ,0 ));
149
+ buttons .setLayout (new FlowLayout (FlowLayout .CENTER ,BUTTONGAP ,0 ));
133
150
134
151
// ordering is different on mac versus pc
135
152
if (Base .isMacOS ()) {
@@ -211,7 +228,7 @@ public void focusLost(FocusEvent e) {
211
228
buttons .setBounds (EDGE -BUTTONGAP , ypos ,
212
229
buttonsDimension .width , buttonsDimension .height );
213
230
214
- ypos += buttonsDimension .height + EDGE ;
231
+ ypos += buttonsDimension .height ;
215
232
216
233
// Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
217
234
0 commit comments