Question: I'm trying to place a series of JLabels at specific X and Y coordinates on a JPanel (and set its height and width, too). No matter what I do, each label winds up immediately to the right of the previous label and has the exact same size as all of the others. 

Right now, my Jpanel is in a Grid Layout. I've tried Absolute Layout (illegal argument exception results), Free Design (no labels appear), Flow Layout (everything just gets squeezed to the center), and a few others.

Not sure what I need to do to make this work. Can anyone help? Thanks!

```
JLabel lbl1 = new JLabel("label 1");
JLabel lbl2 = new JLabel("label 2");
JLabel lbl3 = new JLabel("label 3");
JLabel lbl4 = new JLabel("label 4");
JLabel lbl5 = new JLabel("label 5");

myPanel.add(lbl1);
myPanel.add(lbl2);
myPanel.add(lbl3);
myPanel.add(lbl4);
myPanel.add(lbl5);

lbl1.setLocation(27, 20);
lbl2.setLocation(123, 20);
lbl3.setLocation(273, 20);
lbl4.setLocation(363, 20);
lbl5.setLocation(453, 20);

lbl1.setSize(86, 14);
lbl2.setSize(140, 14);
lbl3.setSize(80, 14);
lbl4.setSize(80, 14);
lbl5.setSize(130, 14);

```

Answer: 
You have to set your container's Layout to null:

```
myPanel.setLayout(null);

```

However is a good advise also to take a look at the Matisse Layout Manager, I guess it is called GroupLayout now. The main problem with absolute positioning is what happens when the window changes its size.
You can use your own method that calling by setSize, setLocation values for directly....! `
As well i show you how to use JProgress Bar

```
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

class installComp{
    void install(Component comp, int w, int h, int x, int y){
        comp.setSize(w,h);
        comp.setLocation(x,y);
    }
}
class MyFrame extends JFrame{
    int cur_val = 0;
    JButton btn = new JButton("Mouse Over");
    JProgressBar progress = new JProgressBar(0,100);
    MyFrame (){
        installComp comp=new installComp();

        comp.install(btn,150,30,175,20);
        comp.install(progress,400,20,50,70);

        btn.addMouseListener(new MouseAdapter(){
            public void mouseEntered(MouseEvent evt){
                cur_val+=2;
                progress.setValue(cur_val);
                progress.setStringPainted(true);
                progress.setString(null);
            }
        }); 
        add(btn);
        add(progress);
        setLayout(null);    
        setSize(500,150); 
        setResizable(false);
        setDefaultCloseOperation(3);
        setLocationRelativeTo(null);
        setVisible(true);
    }
}
class Demo{
    public static void main(String args[]){
        MyFrame f1=new MyFrame();   
    }
}

```