Blackberry JAVA DEVELOPMENT ENVIRONMENT - - CRYPTOGRAPHIC SMART CARD DRIVER - DEVELOPMENT GUIDE Průvodce řešením problémů Strana 131

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 286
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 130
131
7: Creating connections
public void close()
{
closePort();
super.close();
}
}
public static void main(String[] args)
{
new BluetoothSerialPortDemo().enterEventDispatcher();
}
//constructor --------------------------------------------------------------
public BluetoothSerialPortDemo()
{
MainScreen mainScreen = new BluetoothDemoScreen();
mainScreen.setTitle(new LabelField(_resources.getString(TITLE),
LabelField.USE_ALL_WIDTH));
_infoField = new EditField(Field.READONLY);
mainScreen.add(_infoField);
pushScreen(mainScreen);
invokeLater(new Runnable() {
public void run() {
openPort();
}
});
}
// Close the serial port.
private void closePort() {
if (_bluetoothConnection != null) {
try {
_bluetoothConnection.close();
} catch(IOException ioe) {
}
}
if (_din != null) {
try {
_din.close();
} catch(IOException ioe) {
}
}
if (_dout != null) {
try {
_dout.close();
} catch(IOException ioe) {
Zobrazit stránku 130
1 2 ... 126 127 128 129 130 131 132 133 134 135 136 ... 285 286

Komentáře k této Příručce

Žádné komentáře