Fixed « Layout « Java Swing Q&A





1. JFrame layout for fixed position    stackoverflow.com

Which layout is suitable for positioning components on a JFrame and making them stay where they have been placed? I don't want controls to move around on resizing.

2. fixed element in gridbaglayout    coderanch.com

Hi! I want the components of the GUI on the top-left and I don't want them to move to right when the window is resized. import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; public class GridBag3 { private static JFrame frame; private static JLabel lblName; private static JTextField txtName; private static JButton btnSave; public static ...

3. Fixed Form Layout    coderanch.com

Hi Maneesh, Yes, I'm just doing some basic swing stuffs; adding components to a panel but I don't see how overriding getPreferredSize would help. I believe the behaviour is due to the layout manager which try to re-arrange the display dynamically each time. If we would to look at other form designer eg: VB when a label accomodate 20 pixel, it'll ...

4. Fixed Cellsize in GridBagLayout    coderanch.com