import java.awt.event.*;
import java.io.*;
-class ButtonPanel extends Panel implements ActionListener, ItemListener {
+class ButtonPanel extends Panel implements ActionListener {
VncViewer viewer;
Button disconnectButton;
Button clipboardButton;
Button ctrlAltDelButton;
Button refreshButton;
- Checkbox altCheckbox;
- Checkbox ctrlCheckbox;
ButtonPanel(VncViewer v) {
viewer = v;
refreshButton.setEnabled(false);
add(refreshButton);
refreshButton.addActionListener(this);
-
- altCheckbox = new Checkbox("Alt");
- altCheckbox.setEnabled(false);
- add(altCheckbox);
- altCheckbox.addItemListener(this);
- ctrlCheckbox = new Checkbox("Control");
- ctrlCheckbox.setEnabled(false);
- add(ctrlCheckbox);
- ctrlCheckbox.addItemListener(this);
}
//
public void enableRemoteAccessControls(boolean enable) {
ctrlAltDelButton.setEnabled(enable);
- ctrlCheckbox.setEnabled(enable);
- altCheckbox.setEnabled(enable);
}
//
}
}
}
- public void itemStateChanged(ItemEvent evt) {
- viewer.moveFocusToDesktop();
- int state = evt.getStateChange();
- int extraModifiers = 0;
- if (altCheckbox.getState()) { extraModifiers |= InputEvent.ALT_MASK; }
- if (ctrlCheckbox.getState()) { extraModifiers |= InputEvent.CTRL_MASK; }
- viewer.vc.extraModifiers = extraModifiers;
- }
}