0

I making a webcrawler and I only need the GUI to set parameters for the crawling, after that, the execution runs forever in an infinite loop.

It's possible when I start crawling (currently clickin on a button), I dispose of the GUI to free resources and and run the application in text/console mode?

PeeHaa
  • 71,436
  • 58
  • 190
  • 262
Renato Dinhani
  • 35,057
  • 55
  • 139
  • 199

3 Answers3

0

You should be able to close your application's frame. Just make sure that the frame isn't set to exit on close. The only way to exit the process will be to send it a signal of some sort. You might want to arrange to catch the signal so you can exit in a controlled way. Another approach might be to have the process listen on a port for a shutdown message.

Ted Hopp
  • 232,168
  • 48
  • 399
  • 521
0

It's possible. You just need a way to close the GUI programmatically right? This question might be helpful: How to programmatically close a JFrame

So the idea is when you click the button, the handler of the button will send exist signal to the GUI, and start the crawling process (probably by creating some object).

Community
  • 1
  • 1
Alvin
  • 10,308
  • 8
  • 37
  • 49
0

At the very least, you can always start a child console Java process (passing a generated configuration/data file if the amount of data is significant).

Vladimir Dyuzhev
  • 18,130
  • 10
  • 48
  • 62