class ListToolsFrame extends JInternalFrame
{
JLabel titleLabel;
JButton exitButton;
JTextArea outputArea;
RandomAccessFile rafFile;
ListToolsFrame(RandomAccessFile raf)
{
StringBuffer buf2;
rafFile = raf;
try {
rafFile.seek(0);
} catch (IOException e1) {
System.err.println("rafFile.seek(0)");
}
JPanel jp = new JPanel(new BorderLayout());
buf2 = listTools();
titleLabel = new JLabel("List Of Tools");
exitButton = new JButton("Exit");
outputArea = new JTextArea(20, 10);
outputArea.append("Record Number/t/tTool Name/t/tQuantity/t/tPrice");
outputArea.setText(buf2.toString());
final JScrollBar scroller = new JScrollBar();
scroller.add(outputArea);
setLayout(new BorderLayout());
jp.add(titleLabel, BorderLayout.NORTH);
jp.add(exitButton, BorderLayout.SOUTH);
jp.add(scroller, BorderLayout.CENTER);
jp.validate();
//validate();
exitButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
outputArea.setText("");
setVisible(false);
mainView.setVisible(true);
}
});
this.getContentPane().add(jp);
//this.setSize(400, 300);
this.getContentPane().setVisible(true);
}
}
Why isn't my JTextArea showing up on the JPanel inside my JInternalFrame? Any suggestions? Thanks.
-- Curtis