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 113753 - System.out.print output is visible only after the execution ends
Summary: System.out.print output is visible only after the execution ends
Status: RESOLVED DUPLICATE of bug 56341
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 5.x
Hardware: PC All
: P3 blocker (vote)
Assignee: issues@platform
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-24 17:12 UTC by dzintari
Modified: 2008-12-22 14:49 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 dzintari 2007-08-24 17:12:53 UTC
When running or debugging code inside NetBeans, the output window displays the text printed by System.out.print, or 
System.out.format, or System.out.printf calls only when the code ends execution. Calls to System.out.flush don't help 
either. If I use println calls or add \n in the previously listed methods, the code executes properly.

The sample code:

import java.util.Scanner;

public class Test {
    public static void main( String args[] ) {
        Scanner input = new Scanner( System.in );
        
        System.out.print( "Enter first integer: "); 
        //System.out.flush();
       int x = input.nextInt(); 
        
        System.out.print( "Enter second integer: " ); 
        // System.out.flush();
        int y = input.nextInt(); 
        
               
        System.out.printf( "Sum is %d\n", x + y );
        
    } 
    
}
Comment 1 Vladimir Yaroslavskiy 2007-08-28 07:06:08 UTC
I'm not sure that print category is for this issue.
Print category is for Print and Print Preview actions from main menu.
Reassigning for next review...
Comment 2 Milos Kleint 2007-08-28 07:10:17 UTC
duplicate of #56341

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