What is the maximum number of days without sleep they have had?
▲ 12 r/depressionmemes+1 crossposts

What is the maximum number of days without sleep they have had?

I was there for 3 days, and they even hit me with a stick for being "lazy".

u/Shot-Requirement7171 — 3 days ago

[Java Swing] Content JPanel gets cut off when added dynamically inside a main JFrame container

Hi everyone,

I am experiencing a layout issue in a POS system built with Java Swing. I have a main JFrame featuring a sidebar menu on the left. When clicking the menu buttons, I dynamically swap the content panel on the right side using a method to clear and add a new custom JPanel.

The problem is that the newly added content panel gets drastically cut off on the right edge of the screen, causing some elements to overflow or become compressed. It seems like the layout manager of the main frame is not adapting or respecting the sizes correctly when changing views.

The main JFrame layout is structured with a sidebar on the WEST (using BorderLayout) and a main content container in the CENTER where the child JPanels are loaded.

When replacing the view, the following approach is used:

Java

mainContainer.removeAll();
mainContainer.add(newPanel);
mainContainer.revalidate();
mainContainer.repaint();

So far, I have tried modifying setPreferredSize and setSize on the child panels, but it either breaks the layout or gets completely ignored. Calling pack() on the parent JFrame after adding the panel aggressively shrinks and deforms the entire window layout.

What is the best practice to force a dynamic JPanel to fit exactly within the remaining space of the main container without clipping or forcing hardcoded sizes? Should the center container layout manager be switched to something specific?

Thanks in advance for your guidance!

reddit.com
u/Shot-Requirement7171 — 4 months ago

[Java Swing] Content JPanel gets cut off when added dynamically inside a main JFrame container

Body:

Hi everyone,

I am experiencing a layout issue in a POS system built with Java Swing. I have a main JFrame featuring a sidebar menu on the left. When clicking the menu buttons, I dynamically swap the content panel on the right side using a method to clear and add a new custom JPanel.

The problem is that the newly added content panel gets drastically cut off on the right edge of the screen, causing some elements to overflow or become compressed. It seems like the layout manager of the main frame is not adapting or respecting the sizes correctly when changing views.

The main JFrame layout is structured with a sidebar on the WEST (using BorderLayout) and a main content container in the CENTER where the child JPanels are loaded.

When replacing the view, the following approach is used:

Java

mainContainer.removeAll();
mainContainer.add(newPanel);
mainContainer.revalidate();
mainContainer.repaint();

So far, I have tried modifying setPreferredSize and setSize on the child panels, but it either breaks the layout or gets completely ignored. Calling pack() on the parent JFrame after adding the panel aggressively shrinks and deforms the entire window layout.

What is the best practice to force a dynamic JPanel to fit exactly within the remaining space of the main container without clipping or forcing hardcoded sizes? Should the center container layout manager be switched to something specific?

Thanks in advance for your guidance!

reddit.com
u/Shot-Requirement7171 — 4 months ago

Copia en examen de programación?

Que trucos ingeniosos y prácticos existen para hacer copia en un examen en tu propia pc en la universidad donde el docente se sienta hasta atrás para vigilar que no copien pero casi todo el tiempo mira su teléfono, es de programación en netbeans java, esto cuenta como pub de algo educativo xd

reddit.com
u/Shot-Requirement7171 — 6 months ago

Que trucos ingeniosos y prácticos existen para hacer copia en un examen en tu propia pc en la universidad donde el docente se sienta hasta atrás para vigilar que no copien pero casi todo el tiempo mira su teléfono, es de programación en netbeans java

reddit.com
u/Shot-Requirement7171 — 6 months ago