Search:

Type: Posts; User: Cornix

Page 1 of 20 1 2 3 4

Search: Search took 0.27 seconds.

  1. Replies
    5
    Views
    51

    Re: Scanner wont scan?

    Do an internet search for "java equals vs ==" and read carefully about it. I am sure this will help you understand.
  2. Replies
    5
    Views
    51

    Re: Scanner wont scan?

    If you want to compare the contents of Strings you have to use the equals method of the String class. The == operator compares object instances.
  3. Replies
    5
    Views
    51

    Re: Scanner wont scan?

    The problem is your condition. It is highly unlikely that output0 will ever be equal to "Look". Why? Because output0 is an object created by the next() method while "Look" is a String constant...
  4. Replies
    7
    Views
    212

    Re: Compiling on the command line on my mac

    Exactly what andbin said. Thats one more reason to use a good IDE, they will tell you immediately that you are using bad symbols.
    The command line is a good way to get started, to learn how things...
  5. Replies
    7
    Views
    212

    Re: Compiling on the command line on my mac

    Quite the opposite. No professional programmer I know uses the command line to compile his/her sources. The IDE comes with many build in tools for code analysis and other useful features like...
  6. Re: swing application where does startup code belong

    Dont use shutdown hooks for that. It implies that you have a poor understanding of your own program.
    It is YOU who has to program things like entry and exit points of your application. You decide...
  7. Replies
    1
    Views
    181

    Re: Collection Interface

    Simple answer: The video you were watching was probably wrong. Happens on the internet.

    But this really depends on context. Perhaps the person making the video meant to say that most Collection...
  8. Replies
    4
    Views
    131

    Re: Font asset not found

    You have to learn to use internet search engines to find programming tips and solutions, I just put this into google:
    "android studio Typeface.createFromAsset Font asset not found"

    and this is...
  9. Replies
    4
    Views
    131

    Re: Font asset not found

    There is absolutely nothing that we can tell you unless you give us more specifics about the engine you are using to read/display the fonts.
    Are you using Swing? Does the error happen when reading...
  10. Replies
    3
    Views
    296

    Re: Programming structure question

    What is your question? You didnt ask any.
  11. Re: Help with getting database data to a jtext field

    I can not tell you why it gave you that error. You should try to add print statements to your code to find out why the variable you were trying to access was pointing to a null value.
  12. Re: Help with getting database data to a jtext field

    That is something we can not tell you, you have to figure that one out yourself. Why would you need to use a JTextField? What kind of text do you want to appear?
  13. Re: Compilation : compile with new JVM version and run on older version.

    The eclipse compiler (eclipse uses its own compiler rather then the standard) can compile source code with errors. The compiled code will run just fine but when it comes to a point where compile...
  14. Re: addActionListener(this) why can't I use this ?

    When you perform code inside a static methode there is no "this" instance. You dont have an Object of type "PhoneNumbers" created anywhere in your code.

    Furthermore, you are not starting your...
  15. Replies
    13
    Views
    311

    Re: User interacting code within a data class

    Create a new class for this. You need to think Object-Oriented if you want to work with OOP languages and design patterns.

    For example:

    public class UsageReport {
    public boolean...
  16. Replies
    1
    Views
    116

    Re: Some confsion in Interface

    There is no need.

    Any variable you use should use the data type that it needs. If you need the interface you use the interface. If you need instances of your class you use the class.
    An interface...
  17. Re: how to make text label change, depending on text area value?

    Look at the java doc for these classes to get a list of all available methods. Some of these can help you achieve what you want to do, in this particular case you will probably want to use getText()...
  18. Replies
    4
    Views
    179

    Re: Arrays with length > Integer.MAX_VALUE

    Well you cant get much faster then arrays. Just go with multiple arrays, I dont see where the problem is.
  19. Replies
    4
    Views
    179

    Re: Arrays with length > Integer.MAX_VALUE

    How important is performance to you? Because you could always use a LinkedList. These can grow to any size that your memory can hold. Although I am not sure how the standard implementation behaves,...
  20. Re: How to create an abstract class with constructors accepting variables that become static in subclasses? Can you declare abstract static fields?

    There is no "abstract static" in java and no need for it. In general, the "static" keyword and object oriented programming dont go hand in hand.
    In your case the variable really doesnt need to be...
  21. Replies
    13
    Views
    311

    Re: User interacting code within a data class

    You said your items can be used for this:


    this way the View would need to know what kinds of targets are allowed for a given Option. Whether the option is to be used on a Player, on the Ground,...
  22. Replies
    13
    Views
    311

    Re: User interacting code within a data class

    There is actually a lot of change to what you had before. Your old concept had code within the Item class use Dialogs, send messages to the user, etc. This is something that you should not do with...
  23. Replies
    13
    Views
    311

    Re: User interacting code within a data class

    Well, then think about a system that would generalize this. You could have a class like this:

    public interface ItemInteraction {

    public String getName();

    public boolean...
  24. Replies
    13
    Views
    311

    Re: User interacting code within a data class

    That is certainly not what I meant. You have to learn to write your own data structures, the usage of Switch-Case blocks is usually frowned upon.

    I still dont completely understand what exactly...
  25. Replies
    13
    Views
    311

    Re: User interacting code within a data class

    Depends on what exactly you want to do.
    As far as I understood you want to build in some kind of interaction with the player and give each Item of yours a different set of instructions the player...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4