Note that there are some explanatory texts on larger screens.

plurals
  1. POI want to clear my output screen in Java using NetBeans IDE 6.9.1
    text
    copied!<h2><strong>My entire code can be found at the link below, I'm linking it for the sake of a shorter post</strong></h2> <p><a href="http://pastebin.com/6kw8cx3b" rel="nofollow">http://pastebin.com/6kw8cx3b</a></p> <p>I want to clear the Output screen, I'm to make the program simulate a user pressing ctrl+L, which in NetBeans IDE 6.9.1 (which I'm using) clears my output window. However, I'm getting errors with my code.</p> <pre><code>public static void clearme() { try { botthing pressbot = new botthing(); pressbot.keyPress(17); // Holds CTRL key. pressbot.keyPress(76); // Holds L key. pressbot.keyRelease(17); // Releases CTRL key. pressbot.keyRelease(76); // Releases L key. } catch (AWTException ex) { Logger.getLogger(LoginPage.class.getName()).log(Level.SEVERE, null, ex); } } </code></pre> <p>My errors were...</p> <p>Cannot find symbol symbol: class botthing</p> <p>cannot find symbol symbol: class AWTException</p> <p>cannot find symbol symbol: variable Logger</p> <p>cannot find symbol symbol: class LoginPage</p> <p>cannot find symbol symbol: variable Level</p> <p><strong>HOWEVER!</strong> After adding these import statements</p> <pre><code>import java.awt.AWTException; import java.util.*; import java.io.*; import java.util.logging.Level; import java.util.logging.Logger; </code></pre> <p>my errors are...</p> <p>cannot find symbol symbol: class botthing location: class program2</p> <p>exception java.awt.AWTException is never thrown in body of corresponding try statement</p> <p>cannot find symbol symbol: class LoginPage location: class program2</p> <p>I'm not sure what those mean, but I think the java.awt error could be related to my main(), which is public static void main(String[] args) throws IOException</p> <p>All I want to do is clear my output screen. I've also tried </p> <pre><code>for(int x=0;x&lt;999;x++) { System.out.print("\b\b\b\b\b"); } </code></pre> <p>and </p> <pre><code>Runtime.getRuntime().exec("cls"); </code></pre> <p>but both to no avail.</p> <p>If the code I've been trying can't be easily fixed, or if someone knows an easier way, I'd love to know. To clarify, all I want to do is clear my Output window after multiple System.out.println's and such.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload