Search:

Type: Posts; User: Cornix

Page 1 of 20 1 2 3 4

Search: Search took 0.37 seconds.

  1. Replies
    4
    Views
    52

    Re: resizing an array

    First of all you should find out why your index is going out of bounds. Then you should think about it and try to find out what values it should take instead. And then you should change your code to...
  2. Re: getting a char at a location in a string:

    What exactly is your problem? It is not quite clear to me from your description.

    If you want to "get a char at a location" then the charAt(index) method will do just that.
    Or is there something...
  3. Replies
    4
    Views
    52

    Re: resizing an array

    This is the erronous part of your code:


    for(int i = 0 ; i < newSize ; i++){
    newArray[i] = oldarray[i];
    }
    The problem is that you are trying to access an index outside of its bounds....
  4. Replies
    7
    Views
    89

    Re: jframe not drawing background color

    Yes, thats actually correct, I misread that apparently, my mistake.
    This is the relevant source code from the JRootPane class:

    /**
    * Called by the constructor methods to create the...
  5. Replies
    7
    Views
    89

    Re: jframe not drawing background color

    The ContentPane of a JFrame can be changed with the "setContentPane(Container content)" method of the JFrame class. However, the default ContentPane for a JFrame is a JPanel.
    The default...
  6. Replies
    7
    Views
    89

    Re: jframe not drawing background color

    The color of the JFrame is being drawn by its ContentPane. The ContentPane is a JPanel that is placed across the JFrame. Try instead to do:

    myFrame.getContentPane().setBackground(Color.RED);

    To...
  7. Re: Three-dimensional HashMap? HashTable? Looking for guidence.

    Because you try to use a String as the key and a String as the value for your map, but you have declared your map to use two-dimensional String arrays as values.

    By the way, what Norm said earlier...
  8. Re: Need Searching Algorithm Recommendation for my Chatbot AI

    What do you want to use your search algorithm for? Context is what is important, your question sounds like you just want to have a search algorithm but you dont know why you would need it.
  9. Re: Override Class Files, or something different?

    Yes, you are probably right. What you meant wasnt clear to me from your previous post.
  10. Thread: java APIs

    by Cornix
    Replies
    4
    Views
    112

    Re: java APIs

    Maybe ask a magician.
    But on a more serious note, what you describe is incredibly difficult for a computer. There probably are libraries for this somewhere out there, but I dont know if they are...
  11. Re: Override Class Files, or something different?

    In my example there were no abstract methods, an abstract class does not need to have any abstract methods at all, even though it does not make much sense it is completely possible.
  12. Re: Make an abstract class instantiable?

    An abstract class can, by definition, not be instantiated.
    If you want to instantiate it you have to either write a subclass that extends your abstract class or you create an instance of an...
  13. Thread: java games

    by Cornix
    Replies
    2
    Views
    107

    Re: java games

    How good are your java skills? Making games is not trivial.
    What kind of advice would you like to get?
  14. Replies
    6
    Views
    119

    Re: JPF Reputation and how it works.

    I didnt even know this forum had a reputation system. I dont see any option to give positive or negative reputation to anyone.
  15. Replies
    3
    Views
    100

    Re: Basic Syntax Question from a PHP Dev

    In java the syntax for creating object variables is:

    typeOfVariable nameOfVariable = new typeOfObject();

    Because your variable might have a different type then your object when using...
  16. Re: about opening a new window in GUI and making another event work together (Java)

    What are we supposed to say?
    What kind of reaction do you expect?
  17. Re: about opening a new window in GUI and making another event work together (Java)

    Why would you want to only use only one panel? Swing is designed in a way that you are supposed to use several panels for a more sophisticated layout. Dont try to fight the system, you have to learn...
  18. Re: about opening a new window in GUI and making another event work together (Java)

    There are many different ways.
    For one you could have one JPanel with a BorderLayout, within it you have 2 additional JPanels, one at the NORTH position and one at the SOUTH position. The JPanels...
  19. Re: about opening a new window in GUI and making another event work together (Java)

    To set the location of components you have to use the right layout manager.
    The setLocation, setSize and setBounds methods are not supposed to be used by you. The bounds are defined by the layout....
  20. Replies
    2
    Views
    76

    Re: Comparing String To Array Element ?

    What have you tried so far?
    Nobody here is going to write the code for you, but if you have a specific question then we might help you.
  21. Replies
    5
    Views
    63

    Re: Problem with background

    You could write a subclass of JPanel which overrides its "paintComponent(Graphics g)" method do draw an image across its entire bounds.
    This would be fairly simple, clean and effective.

    Google...
  22. Re: Need to read .class files and search for access to blacklisted classes

    Are you sure this is enough to protect yourself against malicious code? I have read, that its supposedly quite tricky, this looks suspiciously simple.
    Of course, I myself have absolutely no...
  23. Re: What Java methods/classes are useful in sorting/resizing a large Minecraft resource pack?

    Possible? Yes.
    What classes and methods might be useful? Very very many.
    What is your question? I dont know really know...


    Of course its possible, everything is possible. But writing a program...
  24. Replies
    4
    Views
    93

    Re: Positioning labels, buttons, etc

    Perhaps you should search the internet for Swing tutorials. LayoutManagers are a very important part of Swing, without them you are not able(*) to create your own Swing GUI's.

    * it is actually...
  25. Re: Need to read .class files and search for access to blacklisted classes

    Dynamically compiling the source code kinda defeats the purpose although it would be possible for a plug-in system.

    About the custom ClassLoader: I have read that there are ways to get around it...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4