source: src/main/java/genius/gui/tournamentvars/SingleValueVarUI.java@ 346

Last change on this file since 346 was 127, checked in by Wouter Pasman, 6 years ago

#41 ROLL BACK of rev.126 . So this version is equal to rev. 125

File size: 867 bytes
RevLine 
[127]1package genius.gui.tournamentvars;
2
3import java.awt.Frame;
4import java.awt.Panel;
5import javax.swing.BoxLayout;
6import javax.swing.JTextField;
7
8import genius.core.tournament.VariablesAndValues.TotalSessionNumberValue;
9import genius.gui.panels.DefaultOKCancelDialog;
10
11public class SingleValueVarUI extends DefaultOKCancelDialog {
12
13 private static final long serialVersionUID = -2316094573538048269L;
14 private JTextField textField;
15
16 public SingleValueVarUI(Frame frame) {
17 super(frame, "Number of sessions");
18 }
19
20 @Override
21 public Panel getPanel() {
22 textField = new JTextField();
23 Panel panel = new Panel();
24 panel.setLayout(new BoxLayout(panel,BoxLayout.Y_AXIS));
25 panel.add(textField);
26 return panel;
27
28 }
29
30 @Override
31 public Object ok() {
32 return new TotalSessionNumberValue(Integer.valueOf(textField.getText()));
33 }
34
35}
Note: See TracBrowser for help on using the repository browser.