Search Results

Search found 53 results on 3 pages for 'nazgulled'.

Page 3/3 | < Previous Page | 1 2 3 

  • How to have variables with dynamic data types in Java?

    - by Nazgulled
    Hi, I need to have a UserProfile class that it's just that, a user profile. This user profile has some vital user data of course, but it also needs to have lists of messages sent from the user friends. I need to save these messages in LinkedList, ArrayList, HashMap and TreeMap. But only one at a time and not duplicate the message for each data structure. Basically, something like a dynamic variable type where I could pick the data type for the messages. Is this, somehow, possible in Java? Or my best approach is something like this? I mean, have 2 different classes (for the user profile), one where I host the messages as Map<K,V> (and then I use HashMap and TreeMap where appropriately) and another class where I host them as List<E> (and then I use LinkedList and ArrayList where appropriately). And probably use a super class for the UserProfile so I don't have to duplicate variables and methods for fields like data, age, address, etc... Any thoughts?

    Read the article

  • Is there a Swing JPanel toolbar background that fits all OSs?

    - by Nazgulled
    I'm using a JPanel to have a toolbar on my background, but I don't like the look of it. Actually, there's basically no look, no background and the buttons are flat when the mouse is not over them. This is on Windows. How can I have a better look for this? Something that would fit better on Windows? Maybe something like the ToolStrip in Visual Studio? Or maybe something better that would look much better depending on the OS version (Windows, Mac, Linux)? Suggestions?

    Read the article

  • How to code the set method of a Map with another Map as value?

    - by Nazgulled
    I normally do this to set a new Map to a private variable: public static void setListaClausulas(Map<String, Clausula> nvLista) { listaClausulas = new TreeMap<String, Clausula>(nvLista); } I suppose this is ok to set a new copy of the nvLista and all it's members and not a reference, is it? But now I have a Map inside another Map and I'm doing this: public static void setListaClausulas(Map<String, Map<String, Clausula>> nvLista) { listaClausulas = new TreeMap<String, Map<String, Clausula>>(nvLista); } Is this the correct way to do it or do you recommend something else? What I want is to set a new copy of nvLista (and all it's elements) and not copy just the reference.

    Read the article

< Previous Page | 1 2 3