Hi I am the stupid girl again..>< forget about the previous reply..mayb i should make myself abit more clear...this is what i want to have eg
entry field:
From:----------(user enter)
To:-------------(user enter)
then it read what the use typed (eg SW1 and SE1) then it search my DB for SW1 and SE1 and return the x and y co ordinates of SW1 and SE1. then it do the pythagorus on those x and y co ordinates..
is this very wrong?
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.border.*;
import java.util.EventObject;
public class distancesystem extends JPanel
{ private JLabel fromLabel;
private JTextField fromField;
private JLabel toLabel;
private JTextField toField;
public CreateDialogPanel()
{ /* Create subcomponents: */
fromLabel = new JLabel("From:");
fromField = new JTextField();
toLabel = new JLabel("To:");
toField = new JTextField();
setBorder(
BorderFactory.createTitledBorder("Create fields"));
add(fromLabel); // Add the subcomponents in
add(fromField); // the order they should appear
add(toLabel); // in the dialog.
add(toField);
}
public void setOldFields(Varchar from, Varchar to,
)
{ fromField.setText(from);
toField.setText(to);
}
public Dimension getPreferredSize()
{ return new Dimension(400,120); }
public Dimension getMinimumSize()
{ return new Dimension(400,120); }
/* Customised layout method, fixed positions
(xstart,ystart,width,height) for components: */
public void doLayout()
{ nameLabel.setBounds(10,10,90,30);
nameField.setBounds(100,15,270,20);
addressLabel.setBounds(10,40,90,30);
addressField.setBounds(100,45,270,20);
phoneLabel.setBounds(10,70,90,30);
phoneField.setBounds(100,75,270,20);
}
public void reset()
{ fromField.setText("");
toField.setText("");
}
public String getFrom()
{ return fromField.getText(); }
public String getTo()
{ return toField.getText(); }
}
public class DistanceCalculationSystem extends JDialog
{ private JPanel bottom; /* Contains buttons: */
private JButton okButton, cancelButton;
/* …