[SOLVED] Help with JPanel
Ok, i just need some help on JPanel
At the moment i have the following code, but am not to sure if its correct or not.
The code is
Code:
import javax.swing.*;
import java.awt.*;
public class BufButPanel extends JPanel
{
private Buf buf;
private JButton sButton;
private JButton rButton;
public BufButPanel(Buf buf)
{
this.buf = buf;
sButton = new JButton("Save");
add(sButton);
rButton = new JButton("Revert");
add(rButton);
}
}
How do i go about in setting it up as a controller for each of the button, and to test if the button are showing, eg open up a new window with the button
Thanks