javax.swing Code Samples
- How do I add items and remove items from JComboBox?
- How do I handle mouse wheel event?
- How do I make a centered JFrame?
- How do I create JLabel with an image icon?
- How do I handle mouse event in swing?
- How do I set the look and feel for swing application?
- How do I create JComboBox?
- How do I change the cursor shape?
- How do I use SwingWorker to perform background tasks?
- How do I get the system look and feel?
- How do I get items of JComboBox?
- How do I customize JButton icons?
- How do I render boolean value as checkbox in JTable component?
- How do I create a ButtonGroup for radio buttons?
How do I place swing component using absolute coordinates?
In this example you can see how we do an absolute positioning to a swing
component in the content panel. In this example we use a JPanel
as the container and we set not layout manager into it.
To position the component on the container we use the setBounds()
method of the component. This method takes the x and y coordinate position and
also the width and heigt of the component.