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

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -