views:

1376

answers:

2

I have output messages displayed on the Java console for an application that started using webstart. Instead of the user manually clearing message, is there a way of clearing console messages in code?

These messages are printed at the rate of about 1000 per second and seem to end up using too much memory, i could have stopped the printing to console, but the requirement is to always have it.

+1  A: 

Seems to me the requirement should be rediscussed. If this isn't an alternative then you may limit the amount of output, because a 1000 messages/s seems an awful lot to me.

I don't know if you even can programmatically clear the console.

boutta
believe you me, i tried.
n002213f
+4  A: 

You will not be able to clear that console, unless you find some handle on the classes for that console (which I doubt you would have access to).

The requirement you have has the inevitable requirement that the user will need to go in and manually clear the console every couple of minutes. I think that justifies a rethink about why the requirement exists and wether there is another solution to solve your problem.

Have you considered a different way of logging?