FileDocCategorySizeDatePackage
ClientFrameTwo.javaAPI DocExample4860Thu Nov 08 00:23:32 GMT 2001com.ora.rmibook.chapter21.printer.applications

ClientFrameTwo

public class ClientFrameTwo extends JFrame implements NetworkConstants

Fields Summary
private JTextArea
_messageBox
private JButton
_chooseFileButton
private JButton
_printFileButton
private JFileChooser
_fileChooser
Constructors Summary
public ClientFrameTwo()

        buildGUI();
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        addWindowListener(new ExitOnClose());
        setSize(250, 200);
    
Methods Summary
private voidbuildGUI()

        JPanel mainPanel = new JPanel(new BorderLayout());

        _messageBox = new JTextArea();
        mainPanel.add(new JScrollPane(_messageBox), BorderLayout.CENTER);
        createButtons();
        JPanel buttonHolder = new JPanel(new GridLayout(1, 2));

        buttonHolder.add(_chooseFileButton);
        buttonHolder.add(_printFileButton);
        mainPanel.add(buttonHolder, BorderLayout.SOUTH);
        getContentPane().add(mainPanel);
    
private voidcreateButtons()

        _chooseFileButton = new JButton("Choose File");
        _chooseFileButton.addActionListener(new FindFile());
        _printFileButton = new JButton("Print File");
        _printFileButton.addActionListener(new PrintFile());