diff options
| author | Joshua Rahm <joshua.rahm@colorado.edu> | 2015-01-30 17:11:48 -0700 |
|---|---|---|
| committer | Joshua Rahm <joshua.rahm@colorado.edu> | 2015-01-30 17:11:48 -0700 |
| commit | 1c5e38fe69ac8a6decbdd8abe93112f4e3369315 (patch) | |
| tree | 926cef8cb76d46862ed2c4ec7028720611e47476 /src/TableSetter.java | |
| download | Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.tar.gz Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.tar.bz2 Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.zip | |
added source
Diffstat (limited to 'src/TableSetter.java')
| -rw-r--r-- | src/TableSetter.java | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/src/TableSetter.java b/src/TableSetter.java new file mode 100644 index 0000000..efa1bdd --- /dev/null +++ b/src/TableSetter.java @@ -0,0 +1,74 @@ +/* */ import java.awt.FlowLayout; +/* */ import java.awt.Toolkit; +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import javax.swing.BoxLayout; +/* */ import javax.swing.JButton; +/* */ import javax.swing.JFrame; +/* */ import javax.swing.JLabel; +/* */ import javax.swing.JPanel; +/* */ import javax.swing.JTextField; +/* */ +/* */ public class TableSetter extends JFrame +/* */ implements ActionListener +/* */ { +/* */ private JButton OK; +/* */ private JButton cancel; +/* */ private ActionListener flg; +/* */ private JPanel main; +/* 19 */ private JTextField[] fields = { +/* 20 */ new JTextField(5), +/* 21 */ new JTextField(5) }; +/* */ +/* 23 */ private JLabel[] lbls = { +/* 24 */ new JLabel("TblStart"), +/* 25 */ new JLabel("TblStep") }; +/* */ +/* */ public TableSetter(ActionListener caller, String[] originals) +/* */ { +/* 28 */ this.flg = caller; +/* 29 */ this.OK = new JButton("Set"); +/* 30 */ this.cancel = new JButton("Cancel"); +/* 31 */ for (int i = 0; (i < originals.length) && (i < this.fields.length); i++) { +/* 32 */ this.fields[i].setText(originals[i]); +/* */ } +/* 34 */ this.OK.addActionListener(this); +/* 35 */ this.cancel.addActionListener(this); +/* 36 */ this.main = new JPanel(); +/* 37 */ this.main.setLayout(new BoxLayout(this.main, 1)); +/* */ +/* 39 */ for (int i = 0; i < this.fields.length; i++) { +/* 40 */ JPanel temp = new JPanel(new FlowLayout()); +/* 41 */ temp.add(this.lbls[i]); +/* 42 */ temp.add(this.fields[i]); +/* 43 */ this.main.add(temp); +/* */ } +/* */ +/* 46 */ JPanel temp = new JPanel(new FlowLayout()); +/* 47 */ temp.add(this.OK); +/* 48 */ temp.add(this.cancel); +/* 49 */ this.main.add(temp); +/* 50 */ add(this.main); +/* 51 */ setIconImage(Toolkit.getDefaultToolkit().getImage("modulus_symbol.png")); +/* 52 */ pack(); +/* */ } +/* */ +/* */ public String[] getText() { +/* 56 */ return new String[] { +/* 57 */ this.fields[0].getText(), +/* 58 */ this.fields[1].getText() }; +/* */ } +/* */ +/* */ public void actionPerformed(ActionEvent e) { +/* 62 */ if (e.getSource() == this.OK) { +/* 63 */ e.setSource(this); +/* 64 */ this.flg.actionPerformed(e); +/* */ } +/* 66 */ setVisible(false); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: TableSetter + * JD-Core Version: 0.6.2 + */
\ No newline at end of file |