Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Problem bei simplem benutzen von IOUtils, keine Eingabe möglich

Empfohlene Antworten

Veröffentlicht

Hi,

ich habe mal ein etwas seltsames Problem, undzwar kann ich trotz IOUtils keine Eingabe tätigen.

Kopiere ich den passenden Codeschnippsel allerdings in eine extra Klasse, so funktioniert es einwandfrei!

Ich füge deshalb mal meine komplette Klasse ein.


import IOUtils.*;

import infoLK.netZA.*;



public class TicTacToeClient extends Client

{


    private String name;

    private String feld;

    private String s;




    //public TicTacToeClient (String pServerIP, int pServerPort, String name) {

    public TicTacToeClient (String name) {     

        super("127.0.0.1", 27051);

        this.name = name;

        send ("N"+name);

    }


    public void processMessage (String pMessage) {

        if (pMessage.startsWith("+YOURTURN")) {

            System.out.println("Du bist am Zug!");

            System.out.println("Bitte gebe die Koordinaten deines Zuges ein! Oben links ist 11 unten rechts 33");

            System.out.print("Koordinate: ");

            String s = IOUtils.readString();

            send("+z"+s);

        } 

        else if (pMessage.startsWith("+QUIT")) {

            send("");

        }

        else if (pMessage.startsWith("+BOARD")){

            feld=pMessage.substring(6,pMessage.length());

            System.out.println(feld.substring(0,3));

            System.out.println(feld.substring(3,6));

            System.out.println(feld.substring(6,9));

        }

    }


    public void sendChat (String message){

        send("@a"+message);

    }


    public void close() {

        send("+QUIT");

        super.close();

    }





}


Normalerweise kann ich ganz simpel in die Konsole eintippen, diesmal nur nicht...

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.