wood burning stoves 2.0*
The moose likes Applets and the fly likes JScrollPane is not reloading the table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "JScrollPane is not reloading the table " Watch "JScrollPane is not reloading the table " New topic
Author

JScrollPane is not reloading the table

Kushi Gadiparthi
Ranch Hand

Joined: Sep 23, 2010
Posts: 52
Hi All,

Can any help me in JScrollPane,

the Jscrollpane is not reloading the table based on the query,

for the first time it is displaying the table and if I pass some date and make changes in the table columns and when I try to reload it ,
It is not reloading the new table,

I am using the code as follows


I will be very thankfull if anyone helps me,
I am loading the JScrollPane in Process() method,

everytime I call the Process() method then the scrollpane should load a new table but it is not doing so,

Can any one please suggest an idea,

Thank you very much,


Jashvika
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

There was a lot of code in that process() method which was irrelevant to your question. Even worse, there was code which was commented out. That takes up space and it's distracting. Not to mention that random indenting makes it hard to read code. But it looked to me like you were creating a new JTable object. Is that right? The usual way to update a JTable with new data is to create a new table model and call the JTable's setModel() method.

If that doesn't help, perhaps you could create a shorter (much shorter) example which displays your problem. Just something which reloads the table. No buttons, no unrelated field, no commented-out code, just code which displays the problem and nothing else.
Kushi Gadiparthi
Ranch Hand

Joined: Sep 23, 2010
Posts: 52
Hello Paul Clapham Sir,

Thank you for your reply,

Here I am giving the code which I am getting the problem



Here is the problem where I am calling the getdata("DSSDEV", startDate1);

My JScrollPane is not clearing the table and it is not reloading the new table based on startDate1

So, please have a lokk and suggest me an idea,

Thank you very much,
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Kushi Gadiparthi wrote:So, please have a lokk and suggest me an idea


Paul Clapham wrote:But it looked to me like you were creating a new JTable object. Is that right? The usual way to update a JTable with new data is to create a new table model and call the JTable's setModel() method.


So, you were doing what I thought. Then do what I suggested.
Kushi Gadiparthi
Ranch Hand

Joined: Sep 23, 2010
Posts: 52
Hello Paul Clapham,

Thank you very much for your reply,

Thanks a lot,
 
Don't get me started about those stupid light bulbs.
 
subject: JScrollPane is not reloading the table
 
Similar Threads
JScrollPane Frustrations
Problem with cell Editing of three columns
Problem displaying JTable inside a JScrollPane
Crypto Challenge Instructions
ActionListener not recognized under Solaris