This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 58737 - System.in.read not allowing input in the ui
Summary: System.in.read not allowing input in the ui
Status: RESOLVED DUPLICATE of bug 47708
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-10 15:19 UTC by bradmallan
Modified: 2005-05-10 16:07 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bradmallan 2005-05-10 15:19:26 UTC
public class Main {
    
    /** Creates a new instance of Main */
    public Main() {
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        readEntry("give me a ...");
    }
    
    
      public static String readEntry(String message)
      {
      try
      {
         StringBuffer buffer = new StringBuffer();
         System.out.print(message);
         System.out.flush();
         int c = System.in.read();
         while (c != '\n' && c != -1)
         {
            buffer.append((char)c);
            c = System.in.read();
         }
         return buffer.toString().trim();
      }
      catch(Exception e)
      {
         return "";
      }
      }
    
}
Comment 1 Marian Mirilovic 2005-05-10 16:03:25 UTC
It has been already fixed for NB4.1 (it will be released next week).
Comment 2 Marian Mirilovic 2005-05-10 16:07:24 UTC

*** This issue has been marked as a duplicate of 47708 ***