java - Two JPanels in one JFrame - the second overrides the first -
I am trying to create a GUI where I add two JPNs to a GeFrame but the second JP Penal I add the override for the first time. In my first JPanel I have a Sudoku box, and in the second I want a button but, beforehand, I always override the other, it does not work.
My Sudoku uses the Zenith grid layout, and it works alone. The problem is that when I try to add the second zeppel (which is a pocket). Since the button requires another size than the squares in the Sudoku box, I can not add this button to the zippin first.
Is it possible to solve using two genels, or do I need a different layout? I've read something about the gridbaglayout and it seems that this can be a solution, but for my zeppel, it's a bit boring to change the whole code in which it has a sudoku
You can create another JPN with a proper layout manager, and add two small panels inside it. Having a panel inside the panel is a good way to break your layout into less complex pieces, while maintaining better control of resizing behavior, etc.
Comments
Post a Comment