import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class FileTest extends JFrame implements ActionListener {
private BoxLayout vbox;
private JPanel panel;
private JPanel topPanel;
private JTextArea txtBox;
private JButton openBtn;
private JButton closeBtn;
public FileTest() {
super("FileTest");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
vbox = new BoxLayout(this, BoxLayout.Y_AXIS);
txtBox = new JTextArea("Hello World", 10, 80);
topPanel = new JPanel();
topPanel.add(txtBox);
add(topPanel);
openBtn = new JButton("Open");
closeBtn = new JButton("Close");
panel = new JPanel();
panel.add(openBtn);
panel.add(closeBtn);
add(panel);
pack();
setVisible(true);
}
@Override
public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub
}
public static void main(String[] args) {
FileTest test = new FileTest();
}
}