Skip to content

Commit d9cbe0a

Browse files
committed
added getNextButtonPanel
1 parent edb50c4 commit d9cbe0a

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

Tutorial-o-Matic/src/main/groovy/ToM_ui.groovy

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,5 +206,40 @@ class ToM_ui{
206206
}
207207
return panel
208208
}
209+
210+
// genera panel close - next page
211+
//nextButtonAction == null --> no 'Next page' button
212+
def static getNextButtonPanel(tabName, closeLabel, closeToolTip, nextLabel, nextToolTip, nextButtonAction ){
213+
def panel = swing.panel(
214+
border : new LineBorder(Color.gray, 1),
215+
name : myButtonPanelName,
216+
) {
217+
borderLayout()
218+
panel(
219+
border : new EmptyBorder(5, 10, 5, 10), // <------- éste
220+
constraints : NORTH
221+
) {
222+
borderLayout()
223+
button(
224+
label : closeLabel,
225+
constraints : WEST,
226+
margin : new Insets(10,15,10,15),
227+
toolTipText : closeToolTip,
228+
actionPerformed : {TabPane.removeTab(tabName)},
229+
)
230+
if(nextButtonAction){
231+
button(
232+
label : nextLabel,
233+
constraints : EAST,
234+
margin : new Insets(10,15,10,15),
235+
toolTipText : nextToolTip,
236+
actionPerformed : nextButtonAction,
237+
)
238+
}
239+
}
240+
}
241+
return panel
242+
}
243+
209244

210245
}

0 commit comments

Comments
 (0)