|  | 		    
					
        
         
          
         
	
          | |  | Tastaturinput på gammel PowerMac 9500, Mac~ Fra : The Weirdest Wacko A~
 | 
 Dato :  15-03-02 00:55
 | 
 |  | Hej!
 
 
 Jeg har prøvet med følgende:
 
 ------------------
 
 import java.io.*;
 
 class Suk
 {
 public static void main (String [] args) throws IOException
 {
 
 BufferedReader tramp;
 
 tramp = new BufferedReader (new InputStreamReader (System.in));
 
 String tekst;
 tekst = tramp.readLine();
 
 System.out.println ("Kommer der noget?: \n" + tekst);
 
 }
 }
 
 
 ------------------
 
 -men det eneste jeg får ud af det er:
 
 ------------------
 
 Kommer der noget?:
 null
 
 ------------------
 
 HVAD gør jeg forkert??!?? Det er som om den slet ikke venter på inputtet,
 men bare går videre.
 
 
 
 Med venlig hilsen,
 
 
 Jens Loldrup Larsen
 
 ThE WeiRdesT wAckO ArouNd
 
 
 
 |  |  | 
  Martin Moller Peders~ (15-03-2002) 
 
	
          | |  | Kommentar Fra : Martin Moller Peders~
 | 
 Dato :  15-03-02 01:38
 | 
 |  | In <B8B6F6F8.9765%uthin@b2mail.dk> The Weirdest Wacko Around <uthin@b2mail.dk> writes:
 
 >Hej!
 
 
 >Jeg har prøvet med følgende:
 
 >------------------
 
 >import java.io.*;
 
 >class Suk
 >{
 >   public static void main (String [] args) throws IOException
 >   {
 >
 >       BufferedReader tramp;
 >
 >       tramp = new BufferedReader (new InputStreamReader (System.in));
 >
 >       String tekst;
 >       tekst = tramp.readLine();
 >
 >       System.out.println ("Kommer der noget?: \n" + tekst);
 >
 >   }
 >}
 >
 
 Det er en windows-bug.
 
 BufferedReader stdin;
 if (OS.isWindows())
 stdin=new BufferedReader(new InputStreamReader(System.in),1);
 else
 stdin=new BufferedReader(new InputStreamReader(System.in));
 
 Hvor OS er en klasse, som f.x. nedenstaaende:
 
 
 public final class OS
 {
 // OS related
 private static boolean isWindows95    =false;
 private static boolean isWindowsNT    =false;
 private static boolean isMacintosh    =false;
 private static boolean isSolaris      =false;
 private static boolean isCaseSensitive=false;
 
 // JVM related
 private static boolean isNetscape     =false;
 private static boolean isMicrosoft    =false;
 private static boolean isHotJava      =false;
 private static boolean isAppleMRJ     =false;
 
 static {
 String os, jvm;
 
 os =System.getProperty("os.name");
 jvm=System.getProperty("java.vendor");
 
 if (os.equals("Windows NT")) isWindowsNT    =true;
 if (os.equals("Windows 95")) isWindows95    =true;
 if (os.equals("Macintosh"))  isMacintosh    =true; // Applet viewer
 if (os.equals("macos"))      isMacintosh    =true; // Netscape
 if (os.equals("MacOS"))      isMacintosh    =true; // Internet Explorer
 if (os.equals("SunOS") ||
 os.equals("Solaris")) {  isSolaris      =true;
 isCaseSensitive=true;
 }
 if (jvm.equalsIgnoreCase("netscape communications corpation"))
 isNetscape=true;
 if (jvm.equalsIgnoreCase("microsoft corp."))
 isMicrosoft=true;
 if (jvm.equalsIgnoreCase("sun microsystems inc."))
 isHotJava=true;
 if (jvm.equalsIgnoreCase("apple computer, inc."))
 isAppleMRJ=true;
 }
 
 public static boolean isWindows() {
 return (isWindows95 || isWindowsNT);
 }
 public static boolean isWindows95()     { return isWindows95;     }
 public static boolean isWinodwsNT()     { return isWindowsNT;     }
 public static boolean isMacintosh()     { return isMacintosh;     }
 public static boolean isSolaris()       { return isSolaris;       }
 public static boolean isCaseSensitive() { return isCaseSensitive; }
 public static boolean isNetscapeJVM()   { return isNetscape;      }
 public static boolean isMicrosoftJVM()  { return isMicrosoft;     }
 public static boolean isHotJavaJVM()    { return isHotJava;       }
 public static boolean isAppleJVM()      { return isAppleMRJ;      }
 
 }
 
 
 
 
 
 |  |  | 
  Thorbjørn Ravn Ander~ (15-03-2002) 
 
	
          | |  | Kommentar Fra : Thorbjørn Ravn Ander~
 | 
 Dato :  15-03-02 09:23
 | 
 |  | 
 
            tusk@daimi.au.dk (Martin Moller Pedersen) writes:
 > Det er en windows-bug.
 Hvordan paavirker den ham under MacOS 8.6?
 -- 
   Thorbjørn Ravn Andersen
  http://homepage.mac.com/ravn |  |  | 
 |  |