0

By clicking on the button opens a new frame and until it is fully loaded (including execute a query in the database) I can not continue to work in the initial JFrame. (edit fields).

How to organize the opening frame (in the background, apparently) without losing focus and editing capabilities?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Df.fpm
  • 189
  • 1
  • 5
  • 15
  • 2
    1) See [The Use of Multiple JFrames, Good/Bad Practice?](http://stackoverflow.com/a/9554657/418556) 2) Don't block the EDT (Event Dispatch Thread) - the GUI will 'freeze' when that happens. Implement a `SwingWorker` for long running tasks. See [Concurrency in Swing](http://docs.oracle.com/javase/tutorial/uiswing/concurrency/) for more details. – Andrew Thompson Feb 05 '14 at 08:26
  • _I can not continue to work_ - then there's something wrong in the code you are not showing (hint, hint :-) – kleopatra Feb 05 '14 at 09:30
  • i mean i (from user's face) can't continue to work without delay caused by database searching. – Df.fpm Feb 05 '14 at 09:43
  • 2
    See [Concurrency in Swing](http://docs.oracle.com/javase/tutorial/uiswing/concurrency/). – trashgod Feb 05 '14 at 10:06

1 Answers1

0

Here is the complete information with great examples. To solve the problem, it suffices to use class SwingWorker

Df.fpm
  • 189
  • 1
  • 5
  • 15