From 33a6649fe95458d365a8d0e1bbe7436b9f7539f5 Mon Sep 17 00:00:00 2001 From: Duncan Foster Date: Mon, 31 Mar 2003 09:50:50 +0000 Subject: Tidy up layout & add comments --- scripting/examples/beanshell/WordCount/wordcount.bsh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'scripting/examples/beanshell') diff --git a/scripting/examples/beanshell/WordCount/wordcount.bsh b/scripting/examples/beanshell/WordCount/wordcount.bsh index 014ad89e3dff..8006f4fed5af 100644 --- a/scripting/examples/beanshell/WordCount/wordcount.bsh +++ b/scripting/examples/beanshell/WordCount/wordcount.bsh @@ -15,10 +15,12 @@ void doDisplay(numWords) { frame.setVisible(false); } }); - frame.getContentPane().setLayout(new GridLayout(2,1)); - frame.getContentPane().add(wordsLabel); - frame.getContentPane().add(closeButton); + frame.getContentPane().setLayout(new BorderLayout()); + frame.getContentPane().add(wordsLabel, BorderLayout.CENTER); + frame.getContentPane().add(closeButton, BorderLayout.SOUTH); frame.pack(); + frame.setSize(190,90); + frame.setLocation(430,430); frame.setVisible(true); } @@ -26,11 +28,15 @@ int wordcount() { result = 0; + // iterate through each of the selections count = xIndexAccess.getCount(); for(i=0;i