T
theAndroidGuy
Hi,
I'm trying to use a simple applet to display content withing a html
page using the applet code given below.
I've a separate class called SolrjTest. I'm getting the result from
one of the methods in that class, and then I want to display the
content. Now the problem is that I'm not able to display the full
content[consisting of many many lines]. What I'm able to see is just a
single line. So can anyone give me some pointers on this issue. Thank
you very much.
----------------------------code snip ----------------------
import java.applet.Applet;
import java.awt.Graphics;
import java.awt.Font;
public class ControlJava extends Applet {
Font f = new Font("TimesRoman", Font.BOLD, 15);
String Message;
public void init() {
Message = new String("ubuntu");
}
public void SetMessage(String MsgText) {
SolrjTest solr = new SolrjTest();
Message = solr.query(MsgText); //Message contains the string that
I want to display
repaint();
}
public void paint(Graphics g) {
g.setFont(f);
g.drawString(Message, 15, 50);
}
}
And the html page that I'm using to display the page is this,
-----------------------------------code snip ---------------------
<HTML>
<HEAD>
<TITLE>Search</TITLE>
</HEAD>
<BODY>
<H3>Solr Search</H3>
<HR>
Enter your search query in the box.
<HR>
<FORM NAME="form1">
<INPUT TYPE="TEXT" NAME="text1">
<INPUT TYPE="BUTTON" VALUE="Search"
onClick="document.ControlJava.SetMessage
(document.form1.text1.value);">
</FORM>
<HR>
<APPLET NAME="ControlJava" CODE="ControlJava.class" WIDTH=1250
HEIGHT=325>
</APPLET>
<HR>
End of page.
</BODY>
</HTML>
Thanks,
Ahmed.
Note:Googling didn't help me much and I'm newbie learning all these
things.
I'm trying to use a simple applet to display content withing a html
page using the applet code given below.
I've a separate class called SolrjTest. I'm getting the result from
one of the methods in that class, and then I want to display the
content. Now the problem is that I'm not able to display the full
content[consisting of many many lines]. What I'm able to see is just a
single line. So can anyone give me some pointers on this issue. Thank
you very much.
----------------------------code snip ----------------------
import java.applet.Applet;
import java.awt.Graphics;
import java.awt.Font;
public class ControlJava extends Applet {
Font f = new Font("TimesRoman", Font.BOLD, 15);
String Message;
public void init() {
Message = new String("ubuntu");
}
public void SetMessage(String MsgText) {
SolrjTest solr = new SolrjTest();
Message = solr.query(MsgText); //Message contains the string that
I want to display
repaint();
}
public void paint(Graphics g) {
g.setFont(f);
g.drawString(Message, 15, 50);
}
}
And the html page that I'm using to display the page is this,
-----------------------------------code snip ---------------------
<HTML>
<HEAD>
<TITLE>Search</TITLE>
</HEAD>
<BODY>
<H3>Solr Search</H3>
<HR>
Enter your search query in the box.
<HR>
<FORM NAME="form1">
<INPUT TYPE="TEXT" NAME="text1">
<INPUT TYPE="BUTTON" VALUE="Search"
onClick="document.ControlJava.SetMessage
(document.form1.text1.value);">
</FORM>
<HR>
<APPLET NAME="ControlJava" CODE="ControlJava.class" WIDTH=1250
HEIGHT=325>
</APPLET>
<HR>
End of page.
</BODY>
</HTML>
Thanks,
Ahmed.
Note:Googling didn't help me much and I'm newbie learning all these
things.