Solved

How to refresh a page

Posted on 2002-05-13
3
214 Views
Last Modified: 2010-04-01
Hi, all

I would like to create a site for the chatting. Users can join a chat group by openning a new window from a parent page. The new window uses applet for message sending. The parent page shows the number of online users. When a user joins a chatting group, the database is updated to add 1 to the onlineNum.

In the java file used for the applet, I need to fresh the parent page when a user join a group. How can I make it refresh when a user is added to the listbox of user? I have try the following code:

lstUser.parent.parent.refresh();

But it doesn't work. Please help me to fix it. Thanks.
0
Comment
Question by:CodeLover
3 Comments
 
LVL 4

Expert Comment

by:pellep
ID: 7006235
var URL=lstUser.parent.parent.document.location;
lstUser.parent.parent.document.location=URL;
0
 

Author Comment

by:CodeLover
ID: 7007196
Hi, pellep

I need the codes for java file, not JavaScript. The lstUser is a component of an Applet.
0
 
LVL 1

Accepted Solution

by:
raid999 earned 50 total points
ID: 7010528
What you can do is add a button when that button is clicked the data will be fetched again from the database and then redisplay every thing again and this should show the new data.

Something like this:
refreshButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        fetchData(dataSource);//here you fetch from database
        mainArea.repaint();//here your redisplay every thing.
      }
    });
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
'exit' is not valid keyword in java 14 156
How to set default webapp for host 6 46
Books that can get me started on JAVA 2 94
web application structure 18 77
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
The question appears often enough, how do I transfer my data from my old server to the new server while preserving file shares, share permissions, and NTFS permisions.  Here are my tips for handling such a transfer.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question