2012-07-18 3 views
2

GUI (Eclipse 및 Windowbuilder로 작성)가 있고, jframe 또는 내 GUI 근처의 새 창에서 System.out을 표시하는 콘솔을 열고 싶습니다. println과 printstacktrace (그 중에서도).GUI에서 java 콘솔 통합

어떻게 할 수 있습니까? 정말 콘솔을 개발해야합니까? System.setOutSystem.setErr를 사용

는 (필자는 사용자가 자신의 cmd.exe를에서 내 항아리를 시작 있는지 확인하고 싶지 않아)

답변

3

, 당신은 다시 직접 수 콘솔 출력을 원하는 PrintStream s로. 따라서 모든 출력을 프레임 안의 텍스트 영역으로 보낼 수 있습니다.

2

은 여러 개체 유형을 표시하기위한 콘솔 창을 표시합니다. 프로젝트에서

:

설명

Java42 개발 콘솔은 자바의 시스템 클래스를 대체합니다. 이것은 응용 프로그램 개발 중에 사용하기위한 개발 도구이지만 제품과 함께 패키지로 제공되거나 함께 제공 될 수도 있습니다.

사용 예제 :

import java42.lang.System; 

System.getManager().initialize(owner); // Owner is your app's JFrame 

// All System.out.xxx methods are routed to the console. 

// Print text: 
System.out.println("Hello Console"); 

// Print components: 
System.out.println(new JButton("Hello Console")); 

// Print images: 
System.out.println(ImageIO.read(imageStream)); 

enter image description here