Click here to Skip to main content
15,892,643 members
Home / Discussions / Java
   

Java

 
GeneralRe: Graduation project Pin
Simon Bang Terkildsen25-Oct-11 11:05
Simon Bang Terkildsen25-Oct-11 11:05 
GeneralRe: Graduation project Pin
Nagy Vilmos25-Oct-11 22:19
professionalNagy Vilmos25-Oct-11 22:19 
AnswerRe: Graduation project Pin
TorstenH.12-Oct-11 18:19
TorstenH.12-Oct-11 18:19 
AnswerRe: Graduation project Pin
CodingLover12-Oct-11 18:57
CodingLover12-Oct-11 18:57 
GeneralRe: Graduation project Pin
gif202013-Oct-11 5:52
gif202013-Oct-11 5:52 
AnswerRe: Graduation project Pin
davidshenba19-Oct-11 18:04
davidshenba19-Oct-11 18:04 
QuestionWebPage can't run applet as signed after another signed applet is disabled Pin
CodeGust11-Oct-11 2:45
CodeGust11-Oct-11 2:45 
Questionhtml in JTextPane or JEditorPane isn't displayed after applet restart on webPage controls refresh Pin
CodeGust10-Oct-11 9:30
CodeGust10-Oct-11 9:30 
Hello,

I have a signed applet. a web page (asks for permissions and) loads and the applet and performs some information processing and writes data to a text file.
Then the web page refreshes a few components and gives the applet a different CSS class (to move it to other position on the page) and the applet reloads, reads data from file and must load it as html into JTextPane.

The problem: when the applet reloads it is given a parameter from html code. This way it knows the now it must display the information to the JTextPane as a list of links in html format. But the JTextPane displays nothing.
I tried to load the html as a simple text and it worked. I also tried to run the applet with the parameter to display data from the very start (when webpage asks for permission to run the applet) and it worked.

So in short I the problem is that when the applet initializes and loads data from the start everything is fine but if it first performs inf. processing and then reloads it cant display html in JTextPane.


I am using javax.swing.JApplet; for applet.
This is the initialization of the applet. It starts the applet as a thread.
<pre lang="java">
public void init() {
try {
jbInit();
new Thread(this, "processFunctionThread").start();
</pre>
jbInit() builds/adds visulal components on the applet.
<pre lang="java">
displayEditorPane = new JEditorPane();
displayEditorPane.setContentType("text/html");
displayEditorPane.setEditable(true);
displayEditorPane.addHyperlinkListener(this);
displayEditorPane.setBounds(new Rectangle(10, 10, 260, 365));
displayEditorPane.setContentType("text/html");
dataScrolling = new JScrollPane(displayEditorPane);
dataScrolling.setBounds(new Rectangle(10, 10, 260, 365));
dataScrolling.setVisible(true);</pre>

public void run() has the main function that (depending on the passed from html parameter) performs actions.
<pre lang="java">
if ( getParameter("scan").equals("doscan") ) {
// performs initial information processing
} else if(getParameter("scan").equals("scanresults")) {
// after the web page gives the applet a different css class it reloads and displays data to JTextPane.
}
</pre>


It's the same either with JEditorPane or with JTextPane.

Please, help me! Thanks
QuestionHelp needed for IPC via scokets Pin
csepratik9-Oct-11 19:49
csepratik9-Oct-11 19:49 
AnswerRe: Help needed for IPC via scokets Pin
Richard MacCutchan9-Oct-11 21:09
mveRichard MacCutchan9-Oct-11 21:09 
AnswerRe: Help needed for IPC via scokets Pin
jschell10-Oct-11 8:17
jschell10-Oct-11 8:17 
Questionhow to transfer PDF file from servlet on server to client Pin
williamroma9-Oct-11 9:22
williamroma9-Oct-11 9:22 
AnswerRe: how to transfer PDF file from servlet on server to client Pin
bennis989-Oct-11 16:13
bennis989-Oct-11 16:13 
GeneralRe: how to transfer PDF file from servlet on server to client Pin
williamroma10-Oct-11 10:24
williamroma10-Oct-11 10:24 
GeneralRe: how to transfer PDF file from servlet on server to client Pin
bennis9810-Oct-11 18:09
bennis9810-Oct-11 18:09 
GeneralRe: how to transfer PDF file from servlet on server to client Pin
williamroma11-Oct-11 5:20
williamroma11-Oct-11 5:20 
GeneralRe: how to transfer PDF file from servlet on server to client Pin
bennis9811-Oct-11 20:47
bennis9811-Oct-11 20:47 
GeneralRe: how to transfer PDF file from servlet on server to client Pin
David Skelly11-Oct-11 22:14
David Skelly11-Oct-11 22:14 
GeneralRe: how to transfer PDF file from servlet on server to client Pin
bennis9812-Oct-11 16:19
bennis9812-Oct-11 16:19 
Questionfor loop to find the lowest price in the array Pin
mastdesi7-Oct-11 13:23
mastdesi7-Oct-11 13:23 
AnswerRe: for loop to find the lowest price in the array Pin
Richard MacCutchan7-Oct-11 21:27
mveRichard MacCutchan7-Oct-11 21:27 
AnswerRe: for loop to find the lowest price in the array Pin
David Skelly9-Oct-11 22:17
David Skelly9-Oct-11 22:17 
QuestionGreen Field Java Pin
cjb1107-Oct-11 1:34
cjb1107-Oct-11 1:34 
AnswerRe: Green Field Java Pin
TorstenH.7-Oct-11 2:42
TorstenH.7-Oct-11 2:42 
GeneralRe: Green Field Java Pin
Nagy Vilmos7-Oct-11 2:51
professionalNagy Vilmos7-Oct-11 2:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.