Hi I am doing a small project using forms. Presently I used netbeans but my classes became very complex as all jpanel ie cards within one class which is a frame. I was asked to simplify.

My question is If I put one jpanel and it contents in one class.and make objects. Can I use cardlayout on these objects? So that cards change within a single frame?

有帮助吗?

解决方案

This problem stems from using the NetBeans GUI editor to manage the top-level container and everything in it. Instead, use the approach shown here to manage multiple separate forms that can be used in your frame's layout. See also Card Layout Actions, cited here.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top