Integer (final RadContainer component) { if (component.getLayout() instanceof BorderLayout) { BorderLayout layout = (BorderLayout) component.getLayout(); return layout.getHgap(); } if (component.getLayout() instanceof FlowLayout) { FlowLayout layout = (FlowLayout) component.getLayout(); return layout.getHgap(); } if (component.getLayout() instanceof CardLayout) { CardLayout layout = (CardLayout) component.getLayout(); return layout.getHgap(); } if (component.getLayout() instanceof AbstractLayout layoutManager) { return layoutManager.getHGap(); } return null; }