0

I have a problem which I can't solve. The application uses a BorderLayout, north is the JToolBar, south status bar and in the center, there is the main frame. When I open a window, it appears in the center. When I want to resize the window manually via the resize-cursor, the toolbar vanishes and after closing the window, the toolbar appears again.

Main Frame with toolbar (red)

Here is the Main Frame without the toolbar

Without the toolbar

Is it maybe happening because of the ActionListener/event or the border layout itself?

I cant really show the code, because its a multi module code with long lines.

Has anybody experienced such a weird behaviour? Where should I start to solve this?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Raydo8
  • 1
  • 1
  • 5
    You will have to include the relevant code in your question. We cannot see what you are doing wrong if we cannot see your code. – Pieter12345 Jul 19 '21 at 14:38
  • 2
    *The application uses a Borderlayout, north is the toolbar, south statusbar and in the center, there is the main frame* - unless you post your proper [mre] we can't verify that statement. Note you don't need 50 items on the toolbar to demonstrate the problem. *I cant really show the code,* - well if you can't simplify the code then we can't help. The problem is with your code, not the BorderLayout. Chances are when you attempt to simplify the code you will find the problem. – camickr Jul 19 '21 at 14:39
  • 2
    *Where should I start to solve this?* - Don't write all the code before you start testing. The trick is to test as you write the code. So you add a toolbar and a couple of buttons and test. If it displays the way you want then you add the status bar and test. Then add the main panel and test. Then add your ActionLIsteners and test. Then when it breaks you know what you just changed and you have a place to start debugging. – camickr Jul 19 '21 at 14:47

0 Answers0