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 4 of 4

Thread: Problem diplaying output infor in GUI

  1. #1
    Junior Member
    Join Date
    Dec 2011
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Problem diplaying output infor in GUI

    Hi,

    I'm am sure what I am trying to accomplish is rather simple but I can't seem to figure it out. I have built a simple mortgage calculator that amortizes the payment over a specified period of time. I can't get the results to display in a box. I have tried list boxes, text boxes, and text fields in combination with scroll panes but can't seem to get anything to work. I'm pretty sure that the code I am trying to use to display the info is wrong, but I have no idea what to use. I was using .setText. I did not include code becasue I was not sure if it was necessary. Thanks for any help.


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Problem diplaying output infor in GUI

    If you want help, you should provide an SSCCE that demonstrates what you're talking about. What exactly do you mean when you say that you can't get anything to work? What does it do instead? Do you see errors? Do you see a strange behavior or the wrong information? Do you see anything? Does it work without a gui?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

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

    Default Re: Problem diplaying output infor in GUI

    The program works fine when I print out my results to the console using System.out.println. I want list out the results in a box within the GUI My question is what swing components and code do I use in order to achieve this.

  4. #4
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Problem diplaying output infor in GUI

    It really depends. You're being a bit too vague to really give you a full answer. If you posted a mockup of what you had in mind, or some sample output, we could maybe give you a more specific answer. As of now, it could be any number of Swing Components- a JTable, some JLabels, a JTextArea, some custom painting on a JPanel, etc.

    Recommended reading: Trail: Creating a GUI With JFC/Swing (The Java™ Tutorials)
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. I cannot get the right output in the right place. Where is my problem?
    By kl2eativ in forum What's Wrong With My Code?
    Replies: 3
    Last Post: September 26th, 2011, 07:28 AM
  2. Problem with Output # of lines
    By coyboss in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 7th, 2011, 10:21 PM
  3. problem with output
    By Timur in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: January 11th, 2011, 09:56 AM
  4. JTextArea output problem
    By grimx in forum What's Wrong With My Code?
    Replies: 5
    Last Post: July 8th, 2010, 07:54 PM
  5. xml output problem
    By tsili in forum Java Theory & Questions
    Replies: 4
    Last Post: May 25th, 2010, 04:56 AM