Results 1 to 3 of 3
  1. #1
    vilislacis is offline Member
    Join Date
    Sep 2009
    Posts
    1
    Rep Power
    0

    Default Multi-dimensional array with different types in it.

    Hi :)

    I have several arrays like this:

    javax.swing.JLabel[] myArray1 = {jLabel1, jLabel2, jLabel3};
    javax.swing.JLabel[] myArray2 = {jLabel2, jLabel3, jLabel4};
    etc.

    Would someone show me, how to put them in one bigger 2D array?

    E.g.:
    myArray[1] = {...};
    myArray[2] = {...};


    --------------------------------------

    Problem solved:

    javax.swing.JLabel[][] myArray = {{labels...}, {labels...}};

    Kthnxbye :)
    Last edited by vilislacis; 09-19-2009 at 10:12 PM. Reason: Problem solved by myself :)

  2. #2
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    7

    Default

    JLabel[][] array = {{label1, label2, label3}, {label4, label5, label6}};

  3. #3
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    7

    Default

    Sorry! I didn't see you had a solution when I posted -- Good Luck!

Similar Threads

  1. [SOLVED] Multi-dimensional Array further help
    By thelinuxguy in forum Advanced Java
    Replies: 4
    Last Post: 05-07-2009, 04:50 PM
  2. Multi-dimensional array program-help!
    By bobmasta5 in forum New To Java
    Replies: 13
    Last Post: 03-15-2009, 07:21 PM
  3. Multi-dimensional array
    By VinTiger in forum New To Java
    Replies: 22
    Last Post: 03-01-2009, 06:51 AM
  4. Multi dimensional Array
    By Preethi in forum New To Java
    Replies: 1
    Last Post: 07-09-2008, 03:34 PM
  5. Help with array multi-dimensional
    By barney in forum New To Java
    Replies: 1
    Last Post: 07-31-2007, 08:00 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •