This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I converted a panel to a frame to make the flow of the program a little better. But, only the first panel and the last label of this class are now showing on the frame (the other panel is not). What am I missing?
I have some things being put in panels and some things placed directly on screen. The last label ('thirdWarn') is displaying and the first panel (eqTypePanel) is showing and nothing else is.
Whereas a JPanel has a FlowLayout for a layout manager by default, a JFrame has a BorderLayout. Everything you just call add() to add to a JPanel gets displayed, one next to the other. But a BorderLayout uses specific named positions on the screen, and if you just call add() with one argument, it uses the default position, which is BorderLayout.CENTER. Each component replaces the last one, instead of them all being displayed together.
If you had a layout that already worked and all you did here was change it to use a JFrame directly instead of a JPanel, then you might simply precede all the GUI code with setLayout(new FlowLayout()), which will make the JFrame act like your JPanel used to.