Rezulto fenestro.
authorviric@llimona
Tue, 24 Jul 2007 23:27:16 +0200
changeset 3 cd313b232546
parent 2 88b94872d8f9
child 4 230eca6e7504
Rezulto fenestro.
src/jdict/AskWord.java
src/jdict/Results.java
--- a/src/jdict/AskWord.java	Tue Jul 24 23:18:15 2007 +0200
+++ b/src/jdict/AskWord.java	Tue Jul 24 23:27:16 2007 +0200
@@ -46,12 +46,7 @@
             Vector results;
             results = index.SearchDefinition(word.getString());
 
-            for(int i=0; i < results.size(); ++i)
-            {
-                StringItem item = new StringItem("Result: ",
-                        (String) results.elementAt(i));
-                myform.append(item);
-            }
+            Results resultsform = new Results(results, myform);
         }
 	}
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdict/Results.java	Tue Jul 24 23:27:16 2007 +0200
@@ -0,0 +1,51 @@
+package jdict;
+
+import javax.microedition.lcdui.*;
+import java.util.Vector;
+
+public class Results
+	implements CommandListener
+{
+	private Form last;
+	private Form myform;
+	private Command cmd_malantauxen;
+
+    Vector myresults;
+	
+	public Results(Vector _myresults, Form _last )
+	{
+        myresults = _myresults;
+        last = _last;
+		show();
+	}
+
+	public void show()
+	{
+		myform = new Form("Rezultoj");
+
+		/* Commands */
+		cmd_malantauxen = new Command("MalantaĆ­en", Command.BACK, 0);
+		myform.addCommand(cmd_malantauxen);
+
+        for (int i=0; i < myresults.size(); ++i)
+        {
+            StringItem item = new StringItem("Rezulto:",
+                    (String) myresults.elementAt(i));
+            myform.append(item);
+        }
+        StringItem item = new StringItem("Entute:",
+                new Integer(myresults.size()).toString());
+        myform.append(item);
+
+		myform.setCommandListener(this);
+		Main.display.setCurrent(myform);
+	}
+
+	public void commandAction(Command c, Displayable d)
+	{
+        if (c == cmd_malantauxen)
+        {
+            Main.display.setCurrent(last);
+        }
+	}
+}