Search:

Type: Posts; User: pbrockway2

Page 1 of 20 1 2 3 4

Search: Search took 0.87 seconds.

  1. Re: JavaFX - How to simply put in play (just make audible) an audio file?

    For applications, the Applet class has a static method newAudioClip(url) which returns an instance of AudioClip with play() etc methods. The fact that it's in the Applet class is an historical...
  2. Replies
    4
    Views
    74

    Re: Alternatives to Array List?

    Just wondering, but I'm not sure I'd read the file a line at a time. Since the count is per character shouldn't the reading be? Remember a char is a numeric type so you can say things like...
  3. Re: Trying to unzip a file but only get java.io.filenotfoundexception

    Do you understand how the exception mechanism works? If not read up about that.

    At the moment you wrap the entire while loop in a try/catch block. It looks like a try/catch block ought to be...
  4. Re: Trying to unzip a file but only get java.io.filenotfoundexception

    If your intention is to obtain a useable set of files from the extraction process then you can (I think!) safely ignore the fact that Thumbs.db does not extract. It is a, usually hidden, system file...
  5. Replies
    6
    Views
    103

    Re: method/array problem

    Yes, it looks good.

    It's worth following Java naming conventions and calling the class HomeworkMethods (with a capital H).

    A couple of things are a little more complicated than they need to be....
  6. Replies
    6
    Views
    103

    Re: method/array problem

    First, welcome to the forums! Sorry, I didn't notice it was your first post or I might not have been as terse as I was about getting you to format the code. Still, you've figured that out... In...
  7. Thread: new in java

    by pbrockway2
    Replies
    2
    Views
    52

    Re: new in java

    Hi pk, welcome to the forums!
  8. Replies
    6
    Views
    103

    Re: method/array problem

    A better way to create the array would be to declare the variable and assign "new int[20]" to it. Then you can use a for loop to populate the array with random ints.

    The way you are printing the...
  9. Re: Creating a new non-static inner class outside of parent class

    What's wrong with assigning a reference to something you create to a variable? Such assignments can improve the readability of otherwise long and dotty lines while taking up zero bytes of compiled...
  10. Re: Creating a new non-static inner class outside of parent class

    As the tutorial points out to create instances of the (nonstatic) inner classes you have to have an instance of the outer class. This acts as the "context" for the inner class instances. Given that...
  11. Re: Trying to unzip a file but only get java.io.filenotfoundexception

    Look out for the fact that both File and ZipEntry instances have a isDirectory() method.

    When you are zipping up a branch of the file system you are interested in the File version which tells...
  12. Re: Cant figure out how to write this method

    "Variable not used" is a warning only, and won't stop a program compiling. It's a useful error because if you declare a variable, but don't use it that is often a sign of a mistake. Such variables...
  13. Replies
    3
    Views
    86

    Re: java with cmd

    The place to check is the API documentation. As you can see the Console methods offer no "clear" functionality.
  14. Replies
    3
    Views
    86

    Re: java with cmd

    There are no methods in the standard Java libraries to do that.

    The language developers seem to have made a decision to favour graphical user interfaces *instead of* the command line. 3rd party...
  15. Re: Trying to unzip a file but only get java.io.filenotfoundexception

    You're welcome.
  16. Re: Trying to unzip a file but only get java.io.filenotfoundexception

    A ZipEntry instance has a sDirectory() method and you can use that to see if you want to append a '/'.

    In fact I wonder whether it wouldn't be "cleaner" to use the method made to determine whether...
  17. Replies
    30
    Views
    1,524

    Re: Reading a files header, hex

    Hi NSK, welcome to the forums!

    I don't know if tomb1992 is around at the moment, and this thread is rather old. It might be a better idea if you start your own thread to ask. Most people will...
  18. Re: How do I adjust the brightness of an image?

    Without seeing the error messages it is very hard to say what is going wrong.

    If they refer to the same line of code then that (or a little before) is the place to start looking for the syntax...
  19. Re: How do I adjust the brightness of an image?

    Compile it and see.

    If there are compiler messages post the complete messages as they're useful in describing what the compiler is grumbling about.
  20. Re: How do I adjust the brightness of an image?

    It's odd that you declare a variable j and have an inner for loop the body of which does the same thing over and over again. What is the body of that for loop supposed to do?
  21. Re: How do I adjust the brightness of an image?

    There's also brighter() in the Color class which appears (from the documentation) to be implemented the way ChristopherLowe suggests. For dealing with a whole image it might be more efficient to...
  22. Replies
    3
    Views
    105

    Re: Exception practice completely lost

    I imagine you have to import this TextIO class.

    What you have seems OK - and once you import TextIO it should compile and run without errors. (If there are errors, post them). Of course you...
  23. Replies
    3
    Views
    105

    Re: Exception practice completely lost

    Copying the contents is rather easy: you use the copyStream() method provided. But I don't think you are at that stage yet. First you have to use the string site to get the data from the url that...
  24. Re: I don't understand what exactly this assignment is asking me to do.

    Java arrays always have a length which gets set when the array is created and never changes thereafter. Moreover, every slot of an array always contains something.

    Other languages are different...
  25. Replies
    2
    Views
    86

    Re: Hello Everyone

    Hi, and welcome! I hope your find the forums a useful supplement to textbooks. Discussion - getting advice and giving it - is both the spice and the meat of learning
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4