I've tried but the button was frozen after i clicked "read from db" button.
could anyone give some examples? thanks.
> I've tried but the button was frozen after i clicked
> "read from db" button.
> could anyone give some examples? thanks.
As a guess, I'd say you are doing the database read on the EventDispatchThread (EDT).
You need to move it off. If you are at Java 1.6, see SwingWorker.
Note you will still need to update the table on the EDT
Prior to 1.6 you'll have to do it yourself. See Tutorial
Or you could get a previous version of SwingWorker from https://swingworker.dev.java.net/
thanks, problem is solved.
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.