Загрузка...

Hide and Resize Panel in GridBagLayout during runtime

Hello everyone! I hope this video has helped solve your questions and issues. This video is shared because a solution has been found for the question/problem. I create videos for questions that have solutions. If you have any other issues, feel free to reach out to me on Instagram: https://www.instagram.com/ky.emrah

Below, you can find the text related to the question/problem. In the video, the question will be presented first, followed by the answers. If the video moves too fast, feel free to pause and review the answers. If you need more detailed information, you can find the necessary sources and links at the bottom of this description. I hope this video has been helpful, and even if it doesn't directly solve your problem, it will guide you to the source of the solution. I'd appreciate it if you like the video and subscribe to my channel!Hide and Resize Panel in GridBagLayout during runtime

I have a JPanel panelOpslog with a GridBagLayout.
On this panel there are 2 Panel. 1 on the top and one on the bottom.
panelOpslog
panelSearchOpsLog
---------------------
panelShiftTeamLogging

panelSearchOpsLog
---------------------
panelShiftTeamLogging

panelSearchOpsLog is set to grow to the bottom and to the right
panelSearchOpsLog
panelOpslog = new JPanel();
tabbedPane.addTab("Opslog", null, panelOpslog, null);
GridBagLayout gbl_panelOpslog = new GridBagLayout();
gbl_panelOpslog.columnWidths = new int[]{1155, 0};
gbl_panelOpslog.rowHeights = new int[]{212, 401, 0};
gbl_panelOpslog.columnWeights = new double[]{1.0, Double.MIN_VALUE};
gbl_panelOpslog.rowWeights = new double[]{1.0, 0.0, Double.MIN_VALUE};
panelOpslog.setLayout(gbl_panelOpslog);

....

panelShiftTeamLogging = new JPanel();
GridBagConstraints gbc_panelShiftTeamLogging = new GridBagConstraints();
gbc_panelShiftTeamLogging.fill = GridBagConstraints.BOTH;
gbc_panelShiftTeamLogging.gridx = 0;
gbc_panelShiftTeamLogging.gridy = 1;
panelOpslog.add(panelShiftTeamLogging, gbc_panelShiftTeamLogging);
panelShiftTeamLogging.setLayout(null);

....

panelSearchOpsLog = new JPanel();
panelSearchOpsLog.setFont(new Font("Tahoma", Font.PLAIN, 10));
panelSearchOpsLog.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED, new Color(255, 255, 255), new Color(160, 160, 160)), "Search Opslog", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
GridBagConstraints gbc_panelSearchOpsLog = new GridBagConstraints();
gbc_panelSearchOpsLog.fill = GridBagConstraints.BOTH;
gbc_panelSearchOpsLog.insets = new Insets(0, 0, 5, 0);
gbc_panelSearchOpsLog.gridx = 0;
gbc_panelSearchOpsLog.gridy = 0;
panelOpslog.add(panelSearchOpsLog, gbc_panelSearchOpsLog);
GridBagLayout gbl_panelSearchOpsLog = new GridBagLayout();
gbl_panelSearchOpsLog.columnWidths = new int[]{129, 0, 0};
gbl_panelSearchOpsLog.rowHeights = new int[]{30, 160, 0};
gbl_panelSearchOpsLog.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
gbl_panelSearchOpsLog.rowWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
panelSearchOpsLog.setLayout(gbl_panelSearchOpsLog);

panelOpslog = new JPanel();
tabbedPane.addTab("Opslog", null, panelOpslog, null);
GridBagLayout gbl_panelOpslog = new GridBagLayout();
gbl_panelOpslog.columnWidths = new int[]{1155, 0};
gbl_panelOpslog.rowHeights = new int[]{212, 401, 0};
gbl_panelOpslog.columnWeights = new double[]{1.0, Double.MIN_VALUE};
gbl_panelOpslog.rowWeights = new double[]{1.0, 0.0, Double.MIN_VALUE};
panelOpslog.setLayout(gbl_panelOpslog);

....

panelShiftTeamLogging = new JPanel();
GridBagConstraints gbc_panelShiftTeamLogging = new GridBagConstraints();
gbc_panelShiftTeamLogging.fill = GridBagConstraints.BOTH;
gbc_panelShiftTeamLogging.gridx = 0;
gbc_panelShiftTeamLogging.gridy = 1;
panelOpslog.add(panelShiftTeamLogging, gbc_panelShiftTeamLogging);
panelShiftTeamLogging.setLayout(null);

....

panelSearchOpsLog = new JPanel();
panelSearchOpsLog.setFont(new Font("Tahoma", Font.PLAIN, 10));
panelSearchOpsLog.setBorder(new TitledBorder(new EtchSource of the question:
https://stackoverflow.com/questions/78985544

Question and source license information:
https://meta.stackexchange.com/help/licensing
https://stackoverflow.com/

Видео Hide and Resize Panel in GridBagLayout during runtime канала Emrah KAYA
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять