Search:

Type: Posts; User: KevinWorkman

Search: Search took 0.09 seconds.

  1. Re: Trying to figure out how to make a screen saver.

    Stack traces are indeed involved with Exceptions, but they are also useful when figuring out why a particular piece of code is running. Print the stack trace. Google is your friend for figuring out...
  2. Re: Trying to figure out how to make a screen saver.

    It isn't a glitch in the IDE- it's just a different behavior. Focus is dependent on the OS, windowing system, what other programs are doing, etc.

    Have you tried printing out the stack trace in the...
  3. Re: Trying to figure out how to make a screen saver.

    What happened when you tried? Did you do any research at all? Did you read any tutorials?



    No. No no no. Stop blaming the compiler. Stop using the term "compiler" to describe things that aren't...
  4. Re: Trying to figure out how to make a screen saver.

    I'm still pretty sure that something with the focus is the problem- it's not a bug, it's not the compiler's fault, and it's pretty much expected behavior. You're probably doing something (or your IDE...
  5. Re: Trying to figure out how to make a screen saver.

    Sigh. What compiler are you using with BlueJ? What compiler were you using with the IDE you were using before? What happens when you compile and run from the command line?

    You STILL have not fixed...
  6. Re: Trying to figure out how to make a screen saver.

    It's not the compiler. I'm not helping you until you slow down and answer the questions I've asked and address the problem I've pointed out. Why bother coming here for help if you're just going to...
  7. Re: Trying to figure out how to make a screen saver.

    Compilers don't have buttons. But I assume you're clicking your mouse in an IDE? Does the JFrame sometimes pop up before you release the mouse, or does clicking the mouse sometimes cause the JFrame...
  8. Re: Trying to figure out how to make a screen saver.

    There sure isn't. Why would there be? I did not tell you to set whether the JFrame was focused, I asked whether it was.



    Uh, okay. And HOW are you running it? From an IDE? By clicking a mouse?...
  9. Re: Trying to figure out how to make a screen saver.

    I honestly don't really know what most of that means. You'd "do it with console" by running it from the command line. I'm not saying enter your input through the console, I'm just saying run the...
  10. Re: Trying to figure out how to make a screen saver.

    It sounds like the application window doesn't have the focus, which we talked about dozens of posts ago (note- focused != focusable). You still haven't fixed the problem of adding components after...
  11. Re: Trying to figure out how to make a screen saver.

    That's good to know, but to get the best help, definitely run from the command line. That's the best way to guarantee that you are running the same thing as the people trying to help you.
  12. Re: Trying to figure out how to make a screen saver.

    I'm curious enough to try to help you, but you have to do what I've asked first. Post an updated SSCCE that fixes the problem with adding components after the JFrame is made visible. Make sure you...
  13. Re: Trying to figure out how to make a screen saver.

    True that. This is the concept of "composition over inheritance" and it might be worth a google.




    Fair enough. But I doubt that Java 7 has anything that will help you, as your problem seems...
  14. Re: Trying to figure out how to make a screen saver.

    It still seems to mostly work for me, ignoring the problem with adding components to your JFrame after it's visible. Why do you do that? Also, why are you extending JFrame when you don't override any...
  15. Re: Trying to figure out how to make a screen saver.

    What did you expect that to do? What does the API say that does? Does the API contain any methods that returns whether a component is focused?



    Are you sure you're running the code you posted,...
  16. Re: Trying to figure out how to make a screen saver.

    Thanks for making the SSCCE. Sorry, but that code seems to work just fine for me. It doesn't exit until I press a key when the JFrame is focused. And it exits every time I press a key when the JFrame...
  17. Re: Trying to figure out how to make a screen saver.

    I don't have time to look through the multiple code dumps and edits you've done- you should keep us up to date with, you guessed it, an SSCCE. Why do you have multiple paint methods? Flickering is...
  18. Re: Trying to figure out how to make a screen saver.

    What in the name of James Gosling do you think this is doing:

    if (str.equals(str)

    And why are you comparing the x and y values in the mouseMoved() function?

    And if you don't care which key...
Results 1 to 18 of 18