Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: SWING GUI CONSOLE WINDOW DISPLAY

  1. #1
    Member
    Join Date
    Dec 2011
    Posts
    38
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default SWING GUI CONSOLE WINDOW DISPLAY

    Hi, i am creating a swing gui and i need to be able to display the return of a function within the gui
    when i call the function the result e.g. System.out.println etc is displayed in the console window, i need what is displayed in the console to be visible in the GUI.
    what component can i use to do this,

    I tried using a Jlabel and setting the labels text to the system.out.println statements but it dosnt work.

    Thanks


  2. #2
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: SWING GUI CONSOLE WINDOW DISPLAY

    Quote Originally Posted by Khadafi View Post
    Hi, i am creating a swing gui and i need to be able to display the return of a function within the gui
    when i call the function the result e.g. System.out.println etc is displayed in the console window, i need what is displayed in the console to be visible in the GUI.
    what component can i use to do this,

    I tried using a Jlabel and setting the labels text to the system.out.println statements but it dosnt work.

    Thanks
    You need to go through these tutorials Lesson: Getting Started with Swing (The Java™ Tutorials > Creating a GUI With JFC/Swing)

  3. #3
    Member
    Join Date
    Dec 2011
    Posts
    38
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: SWING GUI CONSOLE WINDOW DISPLAY

    Thanks thats what I have been using whilst making the GUI.
    but i am not sure of how to display the console within the GUI.

    thanks

  4. #4
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: SWING GUI CONSOLE WINDOW DISPLAY

    Quote Originally Posted by Khadafi View Post
    Thanks thats what I have been using whilst making the GUI.
    but i am not sure of how to display the console within the GUI.

    thanks
    If you thoroughly read the given link tutorial you will for sure get what you desire. Well, did you try text area?

  5. #5
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: SWING GUI CONSOLE WINDOW DISPLAY

    how to display the console within the GUI.
    Are you referring to the Strings printed by calls to System.out.print()?
    You can change where the output goes from that print method call to go to your code where you can put it into a text area.
    See the System class for the method(s) to use.

  6. #6
    Member
    Join Date
    Dec 2011
    Posts
    38
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: SWING GUI CONSOLE WINDOW DISPLAY

    Yes thing printed out via System.out.print().
    Ill try that now.
    Thanks

Similar Threads

  1. Java Tip Jul 29, 2010 - Swing Console Component
    By helloworld922 in forum Java Swing Tutorials
    Replies: 6
    Last Post: April 16th, 2014, 12:08 AM
  2. String won't display in my window
    By JamEngulfer221 in forum AWT / Java Swing
    Replies: 6
    Last Post: November 24th, 2011, 04:23 PM
  3. Replies: 6
    Last Post: January 28th, 2011, 01:13 AM
  4. Java Tip Jul 29, 2010 - Swing Console Component
    By helloworld922 in forum Java Code Snippets and Tutorials
    Replies: 2
    Last Post: August 24th, 2010, 06:48 AM