View Single Post
Old 01-26-07, 06:07 PM   #18
Registered User
Join Date: Jul 2005
Posts: 434
Default Re: Sigh, Java HW Help

Originally Posted by Tuork
Go over to the API and check out the different variations on how to use JOptionPane.

the .showMessageDialogue(...) methos mentioned by rhink is the obvious choice.

You can also print out the info as an actual table, but that's a little more complicated as far as I remember.
Heh JTables can be a real pain in the ass, though this would be a relatively simple application of them. Swing is the worst part of working with java, imo. Extremely flexible, can do a lot with it, but it's also very complex if you do more than scratch the surface, and can be slow.

Marvel, you could certainly create a toString in your customer class that concatenated everything in the objects contained within.

As far as displaying them all.... well, you could pop up a new dialog using joptionpane for every single one, but that would require the user to click through each and every one. If you don't have a requirement to use a GUI, it's very straightforward just to iterate through a loop and do a System.out for each record you want to print. JTables would be a nice, neat way to list them, but they can be difficult to work with. Could also use a JTextArea. It really depends on what you're most familiar with, and exactly what the requirements for this project are.
rhink is offline   Reply With Quote