Type: Posts; User: RonnieVDPoel
Here's what I came up with... The start of your code stays the same.
if (investment <= 0||years <=0 ||rate<=0)
System.out.println("Not enough information - amount must be non-zero.");
If you feel that you shouldn't use container.setlayout you can just use the default layout, which is flowlayout. The two panels will appear in an "orderly" fashion.
What you could do is add the JPanels to a bigger JPanel with a certain layout.
By that I mean that you make a container JPanel so you can add the two panels to this panel before adding this panel to...