+ JTextField callsign_value;
+
+ /* DocumentListener interface methods */
+ public void changedUpdate(DocumentEvent e) {
+ if (callsign_value != null) {
+ String callsign = callsign_value.getText();
+ thread.set_callsign(callsign);
+ AltosUIPreferences.set_callsign(callsign);
+ }
+ }
+
+ public void insertUpdate(DocumentEvent e) {
+ changedUpdate(e);
+ }
+
+ public void removeUpdate(DocumentEvent e) {
+ changedUpdate(e);
+ }
+
+ int row = 0;
+
+ public GridBagConstraints constraints (int x, int width, int fill) {
+ GridBagConstraints c = new GridBagConstraints();
+ Insets insets = new Insets(4, 4, 4, 4);
+
+ c.insets = insets;
+ c.fill = fill;
+ if (width == 3)
+ c.anchor = GridBagConstraints.CENTER;
+ else if (x == 2)
+ c.anchor = GridBagConstraints.EAST;
+ else
+ c.anchor = GridBagConstraints.WEST;
+ c.gridx = x;
+ c.gridwidth = width;
+ c.gridy = row;
+ return c;
+ }
+
+ public GridBagConstraints constraints(int x, int width) {
+ return constraints(x, width, GridBagConstraints.NONE);
+ }