Is it possible to make an ImageIcon array?

Hi, I have been having some strange problems with ImageIcon...
Here is my code...
ImageIcon tiles[][] = new ImageIcon[5][5];
tiles[0][0] = "1.png";
I know this is not right, but basically, I want to make a 2dimensional array of imageIcon's, and then use a loop to set the link to the image. This is tough because I have not had any luck with this code. It works on strings, int's, float's, etc. but not on ImageIcon's grrrrrrr
thanks

All I want to do, Is make an array of ImageIcon's and then use a 2dimensional loop to draw all the tiles.
problem one: I want to use a loop to create each individual ImageIcon, and since there is no "setfile" kind of function i tried making my own in the post above. But im simply trying to make a loop which sets all of the tiles to appropriate file names. (all the file names are numbers and then .png)
Thats all I want to do, and I want to pass a parameter to a function which tells it the filename to set, and the specific ImageIcon in the array to modify. Hence why I had 2 paramater strings in the previous post

Similar Messages

  • Is it possible to make a 2D array (or whatever-dimension) array like..

    Is it possible to make a 2D array (or whatever-dimension) array like this...
            collumn 1                   collumn 2
    Emulated Address   Real Memory address*
               (int)                            (int *)
    +----------------------+----------------------------+
    |            0                |              0xA0               | <-- row 1
    |            1                |              0xA1               | <-- row 2
    |            2                |              0xA2               | <-- row 3
    +----------------------+----------------------------+
    * A = Address.
    is it possible to make an array like that?
    if it is, please tell me how to do it...
    thanks.
    ... I'm trying to make an emulator to emulate the simplest memory.

    Given your other posts, I'm assuming you mean in C, right?
    If so, the answer is yes, but specifically how will depend on a needed clarification of your question.  What you present doesn't really need to be a 2 dimensional array, just one: that looks like a simple list of memory addresses, right?
    At the simplest you can declare an array with two dimensions `iny myarray[2][3];` but to make the table you put up there you'd only need `int *myarray[3];`
    If you also wanted space allocated somewhere that each element of that list pointed to, you could allocate them separately:
    int *myarray[3];
    myarray[0] = (int *) malloc(sizeof(int));
    myarray[1] = (int *) malloc(sizeof(int));
    myarray[2] = (int *) malloc(sizeof(int));
    Obviously with many entries this should be in a loop.  Perhaps not as obviously, why would you not just malloc a larger block of memory to start with?
    What is the end goal?
    EDIT: actually, upon rereading your question, the mallocs are probably irrelevant.  `int *myarray[3]` will get you the array you are looking for.  Just realize that until you point those pointers to memory you 'own' you shouldn't assign to or read from them.
    Last edited by Trilby (2013-04-19 10:06:31)

  • Is it possible to make an array of JButtons?

    is it possible to make an array of JButtons?

    Note that this doesn't create any JButtons, just the array!

  • Is it possible to make a code editor in Java?

    I'm new to java and so i'd like to know if it would be possible to make a simple code editor for Mobile Phones with Java.
    The code editor will be for GML.
    I'd like to make it so that the code can be easily edited on a wide range Mobile phones (not necissarily smart phones).
    If this is possible, I would greatly appreaciate any help or advice. Thanks.
    skinnyeddy

    TuringPest wrote:
    Hippolyte wrote:
    skinnyeddy wrote:
    "first list the areas in which you are proficient" - I'm not. I thought it would be easy to make a simple text/code editor in java without any experience. That was a bit of a mistake. Looks like I'll have to learn the hard way :SIMHO, one should woodshed it, work on programming basics and object-oriented programming fundamentals, in Java for at least one year before attempting to write any GUI code. Even day in this forum we see what code looks like when this advice is not followed.my first java code 5 years ago was an applet with a changing 2d function being animated.
    it worked after 2 grueling days and i was so happy because visual feedback was my only motivation.
    so its hard to say. granted, my code was awful for a long time.I'm thinking of the guy last week who had Swing+JDBC code and kept pestering for help on an obvious syntax error (he was invoking a method with no arguments when it was defined to take a String array) and for the life of him, he couldn't see the error or understand the error message. Posters kept telling him to learn the fundamentals first, but he was stubborn and kept demanding someone fix his syntax error...

  • Is it possible to make a move in contouring mode with onboard program

    I use Labview 7.1.
    I have a motion board 7344.
    Is it possible to make a move in contouring mode (as in the attached vi) with onboard program and how do that?
    Attachments:
    Onboard_program.vi ‏79 KB

    It's not possible to use the contouring mode in an onboard program like you did it in your example. The reason is that while the program is downloaded the write buffer.flx is NOT executed. Thus it can't download the buffer data stored in your front panel arrays. When you start the onboard program later it doesn't have access to your buffer data on the front panel.
    In fact I don't see a real advantage why you would like to run the write buffer.flx in an onboard program. You could configure and download the buffer on the host and then use it in an onboard program.
    Best regards,
    Jochen Klier
    NI-Germany

  • Is it possible to make the automatic scroll go left to right instead of top to bottom?

    Hi all,
    I find it hard to follow text when adobe is scrolling from top to bottom. Is there any way to make it scroll left to right instead?

    user13392320 wrote:
    Is it possible to make ODI process a source row by row instead of as a dataset?Yes it is, the Agent acts like a SQL cursor if you use a select on the source tab (in the IKM) and an insert on the target tab (same step in the IKM) it will read it row by row. You can tweak the batch fetch array sizes in the Agent configuration.
    user13392320 wrote:
    To make changes to the target table I need to join the source table to the target table. I want to process source records in a particular order. What will be loaded from the current source record will depend on the previously loaded, related source record, during this some run of my ODI job. And ideas? Thanks!Cant see why you cant drag the target table onto the source datastores and join them - carefully choose where you want the join to take place (probably in the target). If you want to order the records there are some Knowledge Module tweaks to specify an order by clause using the UD1 -> UD5 flags on a datastore. Search the forum or google for the code.
    Hope this helps.
    Alastair

  • Is possible to make Serializable a Connection object?

    Hi I would like to know if is possible to make Serializable a Connection Object, I would like to save the Connection object into a text file so other class can read it and execute a proper query. If is possible how can I do it?.
    Thanks.

    Actually, if a class isn't already Serializable, you can't make it become Serializable reliably. Consider the following case:
    class A
        int x = 0;
        public void setX(int new_x) { x = new_x; }
        public int getX() { return x; }
    class B extends A implements Serializable
        int y = 0;
        public void setY(int new_y) { y = new_y; }
        public int getY() { return y; }
    public static void main(String arg[]) throws Exception
        B b = new B();
        b.setX(10);
        b.setY(12);
        someObjectOutputStream.writeObject(b);
    }The problem with this is that the implementation of Serializable by class B does not affect class A. In the above example, the ObjectInputStream that obtains the instance of B will have a y value of 12, but an x value of 0 (not 10).
    Thus, unless the Connection object implemented Serializable to begin with, it can't become Serializable. And, as the above post has described, the implementers of the Connection object would not make it Serializable as the local Connection object uses underlying O/S resources which cannot simply be transformed into a byte array.

  • Is it possible to make an alert message.

    Hi,
    Anyone knows if it Is possible to make an alert-message that pops up ( f.e as a little window) on a specific day to remember me of something I have to do that day?
    Would be handy.
    Is this possible with Tiger or is there a third party application that does the trick?
    Thanks in advance.

    Try a free widget called quikAlert
    http://www.apple.com/downloads/dashboard/business/qwikalert.html
    Regards
    TD

  • Is it possible to make a copy of the Leopard install DVD?

    Is it possible to make a copy of the Leopard install DVD? If so, is there a special way this has to be done? I just found out that we needed to use the Leopard install DVD to recover a complete backup from Time Machine after a recent hard drive failure. We have the family pack of Leopard, so I would like to keep the original at home and send a copy when my daughter goes off to college in case she needs to recover again. Her machine was originally a Tiger MacBook, so those install disks will not work. If it is not possible to copy the DVD, is there a way to create a bootable utility to do a time machine recovery?

    This half-solved my problem. I have had no problems creating a backup copy for my intel based computers, but non-intel based computers are problematic; a G5 powermac tower and a G4 Powerbook. Both with super drives for single density burning. Both have Leopard running, installed from an install disc purchased from Apple. However, neither will mount the copy, but intel based computers will. have burnt/burned with both toast 9 and Disc Utility. Discs won't mount and are "spit out" by the drive.
    Power Mac G5 OS X: 10.5.4
    Model Identifier: PowerMac7,3
    Processor Name: PowerPC G5 (3.0)
    Processor Speed: 2 GHz
    Number Of CPUs: 2
    L2 Cache (per CPU): 512 KB
    Memory: 1.5 GB
    Bus Speed: 1 GHz
    Boot ROM Version: 5.1.8f7
    Any thoughts?
    -Jim

  • I am trying to find out if I can change a setting of the calendar in my iPhone.   When I view calendar, in month, I would like to view it with the starting day of the week being Monday, not Sunday.  Is it possible to make this change? SS

    I am trying to find out if I can change a setting of the calendar in my iPhone. 
    When I view calendar, in month, I would like to view it with the starting day of the week being Monday, not Sunday.  Is it possible to make this change?

    Hello SMEvans32
    You can use iCloud to share the Calendar, that way she will always be up to date on that particular section of your work calendar. If you want to use iCloud, I would recommend backing up so you have a safe copy of your data.
    iCloud: Calendar sharing overview
    http://support.apple.com/kb/PH2689
    iCloud Setup
    http://www.apple.com/icloud/setup/
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

  • Top-Level Navigation Bar - Is it possible to make it 3 levels?

    Dear Portal Experts,
    Could someone please advise if it is possible to make the Top-Level Navigation Bar show more than 2 menu levels?  I looked at the document and it said we can only have 1 or 2 levels.  But I'm just wondering if there is any way around it.  Thanks.

    yes you are right .we can set only 1 0r 2 levels but good news is there is a workaround
    follow this blog
    Tag  Libraries: Creating a Hover Menu in SAP NetWeaver Portal
    reward points if helpful

  • Is it possible to make a type cast in TestStand?

    I've got the following problem.
    I use a receive function which waits for an undefined package. (struct package).
    The problem is i can't specify the module with the exaxt package.
    Generally in C i define a Pointer and create enough buffer for it. Is it the same in TestStand?
    Is it possible to make a type cast?
    for example:
    i've got these packages
    struct packet;
    struct  data;
    the function does not know which structure to receive.
    err = receive(buffer,maxlen);
    how do i specify the buffer variable?
    can i create a type "void" with a String to have enough buffer.
    and then to make a type cast, for example "Locals.dataobject = ((data)Locals.buffer)"
    any ideas?
    thx for help

    Unfortunately there is no way to do type-casts in TestStand. What you could do is write a wrapper-dll in C, that has for example two parameters for both possible structs. The dll then takes one of the parameters, does the typecast and passes it on to your original dll.
    From TestStand you can pass the struct(or better container in the "TestStand language") you want to use to the accoridng parameter of the wrapper-dll, leaving the other parameter empty or with some default-value.
    Hope this helps!
    André

  • Hi, can I move my iTunes library to an external hardrive without having to consolidate it as my prehistoric computer just doesn't have the space even though I have deleted everything possible to make room? Please help :(

    Hi, can I move my iTunes library to an external drive without having to consolidate it as my prehistoric computer just doesn't have enough space even though I have deleted everything possible to make room? Please help

    Hi, do you know if this works if I then want to move my library to a new computer as that is my main intention bacause my old computer hasn't got enough space for me to add new albums so I want to ditch the computer (its got to be about 100 years old and doesn't seem to cope well with modern technology!!) and start using my laptop for my iTunes. I am at the point now where i'm ready to throw both my computer and iPod out the window!!!! I might point out as well that in trying to clear space on my computer I accidently deleted the Bonjour programme which is aparently needed to use the home share option, oops!!!!
    Thanks, Kerry

  • Is it possible to make two type of partitions onto an external drive?

    Hi,
    I'm on an intel iMac using Tiger and I know to back up my hard drive I need to choose the GUID partition and Mac OS Extended (Journaled) in order to be able to boot from the partition.
    So if I make 4 partitions is it possible to make 3 partitions GUID Mac Extended (Journaled) and then make 1 that is Apple Partition Map? I tried it and I couldn't figure it out using my Tiger Install disk and selecting Disk Utility option.
    My sister is using a Powerbook PC G4 also using Tiger and I want to make a bootable copy for her as well but just wondering if this can be done?
    S.

    Niel,
    Thanks, so if I format it all as APM I can either clone OSX 10.4.11 which I have on my internal now. If I do a backup of my intel and Powerbook PC both of those will already have Tiger on them so do I need to do another Tiger install on each of those partitions?
    Also by doing it this way I can't boot from a parition onto my intel can I?
    Guess I'll have to weigh whose system is more important or just back up her drive as GUID on my computer and she can restore from it if she has too but won't be able to boot from it.
    S.

  • Is it possible to make a partition in Windows 7 and then place OS X on that partition?

    My employer just gave me a new MBP 13" with Windows 7 on it.  It has bootcamp running, but no option to boot in Mac OS.  IT dept. said they deleted Mac OSX Lion due to security concerns (?).  In any case, as I travel quite a bit and have and ipad and iphone, I would like to use Mac OSX for personal use and Windows 7 for work.
    Is it possible to make a partition in Windows 7 and then place Mac OSX Lion on the partition so that I do not need to reinstall Windows?   I know it would be possible to wipe the HDD and then add Mac OS, then bootcamp, then Windows 7, but adding again would get my IT dept involved which would put me back to square one.
    Any help would be appreciated!!
    JF

    Ok let me ask you IF the IT department of your workplace does NOT want OS X installed on "THEIR" (The Companies) computers because of what they think is some type of security issue why are you trying to go against their wishes and install OS X on a computer that is NOT owned by you.
    That could cost you your job.
    If you continue down this path you will screw up the Windows install and have to take the system back to the IT department to get it fixed. What do you think they will say at that point?
    Do as you like but you would be better off just buying your own Mac computer if you are set on using OS X as your personal operating system.

Maybe you are looking for

  • Report in Matrix format

    Hi, I need to write a report in Materix format i.e. A particular row and coloumn will need to have a value for that combination. Is that possible in SAP? If so please send me some sample code. Thanks in advance, Valuable help will be appriciated. Raj

  • How do I adjust the video display on my G3 iMac

    I think my machine has the 300MHZ processor. It runs fine, but there is a fairly large amount of "black space" that is not being used on the monitor. If it was any other analog monitor, I could change the settings to make the screen expand. But on th

  • Mac 7500 working with a Windows 2003 server?

    Hi all and thanks in advance for any help We have an ancient mac 7500 that is dedicated to running an old version of DNA sequence analysis software (MacVector 6). It is networked in our LAN, and there is a common drive on the server, which is on a De

  • IDoc Message Packages

    All, I went through Sravya's blog on "XI:Idoc Message Packages" and have a question.. probably a non-issue. The blog says you need to activate the IDoc message packages through transaction IDXPW. In that screen one of the value it asks is the message

  • Yahoo mail site has shrunk to tiny unreadable size in upper LH corner

    Something happened last nite when I was using the laptop browser pad. The Yahoomail website shrank into a tiny almost unreadable entity in the extreme upper left hand corner of the screen. I tried moving the cursor around to get it to come back to no