public InterruptibleSocketFrame(){
JPanel northPanel = new JPanel();
add(northPanel, BorderLayout.NORTH);
messages = new JTextArea(TEXT_ROWS, TEXT_COLUMNS);
add(new JScrollPane(messages));
interruptibleButton = new JButton("Interruptible");
blockingButton = new JButton("Blocking");
northPanel.add(interruptibleButton);
northPanel.add(blockingButton);
interruptibleButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent event){
interruptibleButton.setEnabled(false);
blockingButton.setEnabled(false);
canelButton.setEnabled(true);
connectThread = new Thread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
try{
connectInterruptibly();
}catch(IOException e){
messages.append("\nInterruptibleSocketTest.connectInterruptibly: " + e);
}