import java.awt.*; public class Instructions extends Frame { Panel pnlMessage = new Panel (); TextArea cntMessage; Panel pnlButtons = new Panel (); Button cntDispOk; Font normalFont = new Font("Arial", Font.PLAIN, 12); public Instructions ( ) { setTitle ("Instructions"); show();//so insets() will return valid values hide(); resize(insets().left + insets().right + 400, insets().top + insets().bottom + 200); pnlMessage.setLayout (new BorderLayout()); cntMessage = new TextArea (); pnlMessage.add("Center",cntMessage); cntMessage.appendText("Acey Ducey \n\n"); setFont (normalFont); cntMessage.appendText( "Copyright by Creative Computing Morristown, New Jersey\n" + "\n" + "The dealer deals two cards face up. \n" + "You have the opportunity to bet. \n" + "Your bet represents your estimate of the \n" + "likelihood that the next card dealt will \n" + "have a value between the first two. \n"); pnlMessage.resize(400,250); //pnlButtons.setLayout (new BorderLayout()); cntDispOk = new Button ("OK"); pnlButtons.add(cntDispOk); pnlButtons.resize(400,150); //pnlButtons.setBackground("Grey"); add("North", pnlMessage); add("South",pnlButtons); } public boolean handleEvent(Event evt) { if (evt.target == cntDispOk) { hide(); dispose(); return true; } return false; } }