File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes JFrame vs JPanel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JFrame vs JPanel" Watch "JFrame vs JPanel" New topic

JFrame vs JPanel

Jason Moore

Joined: Sep 11, 2001
Posts: 10
I'm working with some legacy code that was designed poorly. Instead of using mulitple JPanels and switching between them on a single JFrame, every "screen" is implemented using its own JFrame. Then each frame is hidden/shown when needed. Is there enough benefit in using JPanels over JFrames to go back and rewrite this code?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

I am by no means am expert in development, however, my opinion is that if the interface is understandable and funcional and is somewhat user friendly, I see no need to go back and redo the code.
The only reason I see in changing, is if you see a change in the software in the near future that would require a JTabbedPane. Then, you should probably get starting on the integration now.
Just my two cents

Happy Coding,
Gregg Bolinger

GenRocket - Experts at Building Test Data

Joined: Sep 06, 2001
Posts: 22
I personally would prefer having least number of components. Just one frame and rest of them panels/panes whatever.
Again, just my 2 paisas
I agree. Here's the link:
subject: JFrame vs JPanel
It's not a secret anymore!