3

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.

4

2 回答 2

5

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?

于 2009-03-03T13:07:06.360 回答
1

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.

于 2009-03-03T11:58:24.327 回答