Top "Layout-manager" questions

Layout Managers are a collection of standard Java based layout managers for AWT & Swing components.

Not able to add JTextField to JFrame

I am not able to add JTextField to JFrame. My JFrame contains a JLabel and a JTextField . First, i have …

java swing jframe jtextfield layout-manager
Why setVisible doesn't work?

I have a swing GUI with border layout. in the NORTH I have added some component. My label component which …

java swing gif layout-manager border-layout
Dimension, Only changing the width/height

How do I only change the width or height of a component that requires a Dimension object? Currently I do …

java swing layout-manager dimension
GroupLayout can only be used with one container at a time

Not sure why this error is coming up. I am using GroupLayout because I want it to do the spacing …

java swing exception layout-manager grouplayout
setAlignmentX(CENTER_ALIGNMENT) does not center boxLayout in JFrame

I want to keep my two JLabel text have Left alignment and at the same time place my boxLayout in …

java swing layout-manager boxlayout
GridBagLayout: equally distributed cells

Is it possible to completely emulate the behavior of a GridLayout with the GridBagLayout manager? Basically, I have a 8x8 …

java swing layout-manager gridbaglayout
CardLayout, switch between JPanels by ButtonClick

I want to switch between JPanels by clicking buttons on the JPanels. For example: I have a JPanel sim with …

java swing awt layout-manager cardlayout
Set constant size of JScrollPane

I have a JTabbedPane with a Border Layout. Here's the code I'm using to add the components: add(columnNames, BorderLayout.…

java jscrollpane layout-manager jtabbedpane border-layout
How to give spaces between jlabel?

Hi i am trying to make java desktop application where i am using multiple jlabel i want to give little …

java swing jlabel layout-manager null-layout-manager
How to make the vertical gap in a BoxLayout smaller?

I've got the following form which uses a vertical BoxLayout and FlowLayout JPanels for rows: How can I make the …

java swing user-interface layout-manager boxlayout