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.
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?
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.
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)