Proxim RangeLAN2 7920 Instrukcja Użytkownika Strona 79

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 103
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 78
64
JButton stop = new JButton("Stop");
stop.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent ev) {
try {
cmdOut.write("x,3,\n".getBytes());
model.addElement(cmdIn.readLine());
} catch (Exception ex) {
}
leftMotor.setValue(STOP);
rightMotor.setValue(STOP);
bothMotor.setValue(STOP);
}
});
gbc.gridx = 3;
gbc.gridy = 3;
gbc.gridwidth = 2;
gbc.gridheight = 2;
gbc.ipadx = 10;
gbc.ipady = 10;
gbc.insets = new Insets(10,0,0,0);
gbl.setConstraints(stop, gbc);
butt.add(stop);
//FORWARD BUTTON
JButton forward = new JButton("Forward");
forward.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent ev) {
try {
cmdOut.write("x,2,200,\n".getBytes());
model.addElement(cmdIn.readLine());
} catch (Exception ex) {
}
leftMotor.setValue(STOP+50);
rightMotor.setValue(STOP+50);
bothMotor.setValue(STOP+50);
}
});
gbc.gridx = 3;
gbc.gridy = 1;
gbc.gridwidth = 2;
gbc.gridheight = 1;
gbc.ipadx = 20;
gbc.ipady = 20;
gbc.insets = new Insets(5,5,5,5);
gbl.setConstraints(forward, gbc);
butt.add(forward);
//LEFT TURN BUTTON
JButton leftturn = new JButton("Left Turn");
leftturn.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent ev) {
Przeglądanie stron 78
1 2 ... 74 75 76 77 78 79 80 81 82 83 84 ... 102 103

Komentarze do niniejszej Instrukcji

Brak uwag