I have developed an htmleditor in java.Now i have installed that applet on my website to format data that would be coming from database.My question is that I am calling a java function from javascript,when i pass small amount of text to my java function callPanelToSetText(String data) it sets the jtextpane correctly.However when i pass large amount of text the applet hangs and does not display the text in jtextpane.
<head>
<title>Test page for launching the applet via JNLP</title>
</head>
<body>
<h3>Test page for launching the applet via JNLP</h3>
<script src="http://java.com/js/deployJava.js"></script>
<script>
var attributes = {
code: "researchtexteditor.EditorApplet",
archive: "ResearchHTMLEditor.jar, lib/jortho.jar",
width: 600,
height: 600,
id: 'EditorValue'
};
var parameters = {jnlp_href:"launch.jnlp"}; <!-- Applet Parameters -->
var version = "1.7"; <!-- Required Java Version -->
deployJava.runApplet(attributes, parameters, version);
</script>
<!-- Or use the following applet element to launch the applet using jnlp_href -->
<!--
<applet width="300" height="300">
<param name="jnlp_href" value="launch.jnlp"/>
</applet>
-->
</body>
<p><a href="javascript:enterNums();">Launch Example</a></p>
<p><a href="javascript:enterNums_get();">Launch Example1</a></p>
</html>
<script language="javascript">
function enterNums(){
var content='<?php echo $row['rep_contents'];?>';
alert(content);
//document.write('Value from Jtextpane 11 '+content);
EditorValue.callPanelToSetText(content);
}
function enterNums_get(){
var TextVal=EditorValue.getTextData();
document.write('Value from Jtextpane '+TextVal);
}
<!-- ... -->
\
Function callPanelToSetText(String value) from java is as below
public static void callPanelToSetText(String value)
{
try {
SimpleAttributeSet attr=new SimpleAttributeSet();
StyleConstants.setFontFamily(attr,"Arial");
StyleConstants.setFontSize(attr,13);
StyleConstants.setForeground(attr,Color.BLACK);
StyleConstants.setBold(attr,false);
StyleConstants.setItalic(attr,false);
editorPanel1.htmlDoc.insertString(editorPanel1.htmlDoc.getLength(),value,attr);
} catch (BadLocationException ex) {
Logger.getLogger(EditorApplet.class.getName()).log(Level.SEVERE, null, ex);
}
}
The text that i wish to set on jtextpane is
String val="CHAPTER 1 INTRODUCTION 13\n" +
"1.1 Report Description 13\n" +
"1.2 Reason for doing the study 14\n" +
"1.3 Key Benefits 14\n" +
"1.4 Key Market Segments 15\n" +
"1.5 Key Audiences 15\n" +
"1.6 Research Methodology 15\n" +
"1.6.1 Secondary research 16\n" +
"1.6.2 Primary research 16\n" +
"1.6.3 Analyst tools and models 18\n" +
"CHAPTER 2 EXECUTIVE SUMMARY 19\n" +
"2.1 Market beyond: what to expect by 2025 22\n" +
"2.1.1 Moderate growth scenario 22\n" +
"2.1.2 Rapid growth scenario 24\n" +
"2.1.3 Diminishing growth scenario 26\n" +
"CHAPTER 3 MARKET OVERVIEW 29\n" +
"3.1 Market Definition and Scope 29\n" +
"3.2 Key findings 30\n" +
"3.2.1 Top Factors Impacting transparent conductive films market 30\n" +
"3.2.1.1 Rising adoption of touch UI devices 30\n" +
"3.2.1.2 Declining cost of smartphones 30\n" +
"3.2.1.3 Low power consumption 30\n" +
"3.2.1.4 Minimal reflection 30\n" +
"3.2.1.5 Thinness 31\n" +
"3.2.1.6 Flexibility/robustness 31\n" +
"3.2.1.7 Lack of one-size-fits-all solution 31\n" +
"3.2.1.8 The multiplicity of options is giving rise to market uncertainty and confusion 32\n" +
"3.2.2 Top Investment Pockets 34\n" +
"3.2.3 Top winning strategies 34\n" +
"3.3 Porter’s five force analysis 35\n" +
"3.3.1 Large number of suppliers leads to lower bargaining power of suppliers 36\n" +
"3.3.2 Lower switching cost leads to high Buyer power 37\n" +
"3.3.3 Unavailability of substitute lowers the may raise the threat of complete substitution 37\n" +
"3.3.4 Economies of scale leads to low threat of new entrants 37\n" +
"3.3.5 Numerous competitors lead to high rivalry 38\n" +
"3.4 Value chain analysis 38\n" +
"";
Can anyone please tell me where i am going wrong.Thanks and Regards in advance.