What's the specific problem that you are having? And next time use code tags when posting code.
When I was learning how to program GUI's in Java I used a DisplayWindow, Panel, Driver model. The DisplayWindow was pretty basic, just the properties of the window. And the Panel would hold all the components, then it would be put on the DisplayWindow.
I made a sample program which you can go by I hope it helps:
DisplayWindow:
CODE
import java.awt.*;
import javax.swing.*;
public class DisplayWindow extends JFrame{
private Container c;
public DisplayWindow(){
super("Sample Program");
c = this.getContentPane();
}
public void addPanel(JPanel p){
p.setPreferredSize(new Dimension(2000, 2000));
c.add(p);
}
public void showFrame(){
this.pack();
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
The Panel (GraphicsPanel), this is where your code and functionality go:
CODE
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class GraphicsPanel extends JPanel implements ActionListener{
//Label
JLabel aLabel = new JLabel("This is a label");
//Button
JButton aButton = new JButton("This is a button);
//Textfield
JTextField aTextField = new JTextField(8);
public GraphicsPanel(){
this.add(aLabel);
this.add(aButton);
this.add(aTextField);
aButton.addActionListener(this);
}
public void actionPerformed(ActionEvent e){
if(e.getSource == aButton){
aLabel.setText("I changed the text of the label");
//do other stuff in the actionPerformed place
}
}
}
And here is the driver for the program:
CODE
import java.awt.*;
import javax.swing.*;
public class GraphicsDriver{
public static void main(String[] args){
DisplayWindow d = new DisplayWindow();
GraphicsPanel p = new GraphicsPanel();
d.add(p);
d.showFrame();
}
}
Hopefully this helps, essentially you could just replace the code from the sample I gave you, and add stuff to it, but actually try to see how it works.