JTable in two dimension

Hi,
Can anyone show me how to create JTable in this format.
Time 12pm-1pm 1pm-2pm 2pm-3pm 3pm-4pm 4pm-5pm
Day\Date
Monday     (date)                    
Tuesday     (date)                    
Wednesday (date)                         
Thursday     (date)                    
Friday     (date)                    
Saturday     (date)                    
Sunday     (date)                    
Actually each object is in a cell. And one more question.
1)How to set time by using Windows's timing and set besides of each day.
2)How to let JTable follows exactly the calendar.For instance,this month the first monday is 21/1,but next month maybe the monday will be 3/2.How to do that.

1. Are you saying you want a JTable which has both a row header and column header?
2. You'll need to use the Calendar class to determine the appropriate day of the week given a Date object. As so:
Calendar cal = Calendar.getInstance();
cal.setTime(myDate);
int dayOfWeek = cal.get(Calendar.DAY OF WEEK);
String[] daysOfWeek = DateFormatSymbols.getDaysOfWeek();
String dayOfWeekStr = daysOfWeek[dayOfWeek];PS: There is a lot in Java that people don't know about. Make sure you download the Java API source, as well. I had trouble figuring out how to convert the int day to a String day, so I went into the source for SimpleDateFormat to figure out how it does it...and I find another useful Java class in DateFormatSymbols.

Similar Messages

  • Two dimension in JTable

    Hi,
    Can anyone tell me how to write two dimension in JTable?1 row for title and 1 column for another title.
    Another question is,how to write JTable in a report format,such as few columns for expenses and at the end a total for the whole expenses.How to add the total at the end of the table?
    Thanks for any help.

    1. Are you saying you want a JTable which has both a row header and column header?
    2. You'll need to use the Calendar class to determine the appropriate day of the week given a Date object. As so:
    Calendar cal = Calendar.getInstance();
    cal.setTime(myDate);
    int dayOfWeek = cal.get(Calendar.DAY OF WEEK);
    String[] daysOfWeek = DateFormatSymbols.getDaysOfWeek();
    String dayOfWeekStr = daysOfWeek[dayOfWeek];PS: There is a lot in Java that people don't know about. Make sure you download the Java API source, as well. I had trouble figuring out how to convert the int day to a String day, so I went into the source for SimpleDateFormat to figure out how it does it...and I find another useful Java class in DateFormatSymbols.

  • Two dimension in JTable and date.

    Hi,
    Can anyone show me or teach me how to create two dimension in JTable.
    The column is time ie 12pm-1pm, 1pm-2pm.......3am-4am, and the row is monday, tuesday .....sunday.And row should consists of day and date ie monday 1/4,tuesday 2/4.....sunday 8/4.
    Thanks for any help.

    Hi,
    You cannot automatically filter members using a mapping based on the smart list. To do that work, i recommend using an UDA (User Defined Attribute) or create an attribute dimension associated to your employee dimension.
    Regards,
    David Mendele
    BI / EPM Project manager at Business & Decision
    Lima, Peru

  • How to get Distinct Count of Products across two dimensions

    Hi,
    I have two dimensions, Item and Presentations. I need to get distinct count of products for IMD_Id + Merc_Pres_Id. IMD_Id is the lowest member in Item and Merc_Pres_Id is lowest in Presentation. My MDX query is given below but when I apply filters to
    slice it, it does not work and does not give right count. It always gives the count for all.
    /* Last Year Demand - Demand for 12 months back of selected months */
    With
    Member [Measures].[LYDemand]
    as
    Sum(
    Generate(
    EXISTING[All Date].[Fiscal Month Name].[Fiscal Month Name].Members,
    {parallelperiod([All Date].[Fiscal Month Name].[Fiscal Month Name], 12
    ,[All Date].[Fiscal Month Name].CurrentMember)}
    ,[Measures].[Proj Demand]
    /* Last to last Year Demand - Demand for 24 back of selected months */
    Member [Measures].[LLYDemand]
    as
    Sum(
    Generate(
    EXISTING[All Date].[Fiscal Month Name].[Fiscal Month Name].Members,
    {parallelperiod([All Date].[Fiscal Month Name].[Fiscal Month Name], 24
    ,[All Date].[Fiscal Month Name].CurrentMember)}
    ,[Measures].[Proj Demand]
    /* Current Year Active Products */
    Member [Measures].[CYCount]
    as
    CASE
    WHEN
    [Measures].[Proj Demand] > 0
    THEN
    DistinctCount(Existing(([All Items].[IMD Id].[IMD Id],[All Merchandise Presentations].[Merch
    Pres Key].[Merch Pres Key])))
    ELSE
    NULL
    END
    /* Last year Active Products */
    Member [Measures].[LYCount]
    as
    CASE
    WHEN
    [Measures].[LYDemand] > 0
    THEN
    DistinctCount(([All Items].[IMD Id].[IMD Id],[All Merchandise Presentations].[Merch Pres Key].[Merch Pres
    Key], [All Items].[Style Name].CurrentMember, (StrToMember('[All Date].[Fiscal Month Name].&[201401]',CONSTRAINED).Lag(12)
    : StrToMember('[All Date].[Fiscal Month Name].&[201411]',CONSTRAINED).Lag(12))))
    ELSE
    NULL
    END
    /* Last to last Year Active Products */
    Member [Measures].[LLYCount]
    as
    CASE
    WHEN
    [Measures].[LLYDemand] > 0
    THEN
    DistinctCount(([All Items].[IMD Id].[IMD Id],[All Merchandise Presentations].[Merch Pres Key].[Merch Pres
    Key], [All Items].[Style Name].CurrentMember, (StrToMember('[All Date].[Fiscal Month Name].&[201401]',CONSTRAINED).Lag(24)
    : StrToMember('[All Date].[Fiscal Month Name].&[201411]',CONSTRAINED).Lag(24))))
    ELSE NULL END
    SELECT
    [Measures].[CYCount], [Measures].[LYCount], [Measures].[LLYCount],
    [Measures].[Proj Demand],[Measures].[LYDemand],[Measures].[LLYDemand]
    ON
    COLUMNS,
    Non
    Empty([All Items].[Demand Center Name].[Demand Center Name], [All Items].[Style Name].[Style Name])
    ON ROWS
    FROM
    (SELECT (StrToSet('[All Items].[Style].[ALL]'))
    ON COLUMNS
    FROM
    (SELECT (StrToSet('[All Items].[Demand Center].[ALL]'))
    ON COLUMNS
    FROM
    (select (STRTOSET('[All Items].[Merch Group].&[MG-110]'))
    on Columns
    FROM
    (SELECT (StrToSet('[All Merchandise Presentations].[Merch Pres Chnl Dkey].&[MPC-1]'))
    ON COLUMNS
    From
    [FMI Forecasting]
    WHERE {strToMember('[All Date].[Fiscal Month
    Name].&[201401]',CONSTRAINED) :
    StrToMember('[All Date].[Fiscal Month Name].&[201411]',CONSTRAINED)}
    Requirements are as follows:
    1. Distinct Count should not include products where Proj Demand is 0, when I am using Filter function to remove products with 0 demand, query is really slow and execution time goes up from 35- 40 secs to 8-9 Minutes.
    2. When we apply filter (parameters) Distinct Count should be in the context of filters( which are mentioned in the select statement like Style, Demand Center and Merch Group). Currently after applying filters count does not change.
    Thanks for help.

    Hi Skd78,
    Thank you for your question. 
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated. 
    Thank you for your understanding and support.
    Regards,
    Charlie Liao
    TechNet Community Support

  • In Top 10 with two dimension i need to add others in my MDX query

    Hi this is code working fine and return top 2  product in a  state. i need to add other sales also how can we do
    with set FIPS as [Geography].[State-Province].[State-Province]
    set TCat as
    Generate( {FIPS}, CrossJoin( {[Geography].[State-Province].CurrentMember},
    TOPCount(
             ([Product].[Subcategory].[Subcategory]),
             2,
             [Measures].[Sales Amount]
    SELECT { [Measures].[Sales Amount] } ON COLUMNS,
    TCat  ON ROWS
    FROM [Adventure Works]
    hi fond one code it is work for one dimension only, i need for two dimension
    WITH
    SET [TCat] AS
    TopCount([Product].[Subcategory].[Subcategory],10,[Measures].[Sales Amount])
    MEMBER [Product].[Subcategory].[Other] AS
    Aggregate([Product].[Subcategory].[Subcategory] - TCat)
    SELECT { [Measures].[Sales Amount] } ON COLUMNS,
    TCat + [Other] ON ROWS
    FROM [Adventure Works]

    Hi,
    We will have to generate a set of tuples that includes both dimensions:
    WITH
    SET [Top2] AS
    Generate
    {[Customer].[State-Province].[State-Province].MEMBERS}
    [Customer].[State-Province].CurrentMember
    ,TopCount
    (EXISTING
    [Product].[Subcategory].[Subcategory].MEMBERS)
    ,2
    ,[Measures].[Internet Sales Amount]
    MEMBER [Product].[Subcategory].[All].[top2Aggr] AS
    Aggregate((EXISTING [Top2]))
    MEMBER [Product].[Subcategory].[All].[all Subcat] AS
    [Product].[Subcategory].[All]
    MEMBER [Product].[Subcategory].[All].[others] AS
    Aggregate
    (EXISTING
    [Customer].[State-Province].CurrentMember
    ,[Product].[Subcategory].[Subcategory].MEMBERS
    [Top2])
    SELECT
    {[Measures].[Internet Sales Amount]} ON COLUMNS
    [Customer].[State-Province].[State-Province].MEMBERS
    [Product].[Subcategory].[top2Aggr]
    ,[Product].[Subcategory].[others]
    ,[Product].[Subcategory].[all Subcat]
    } ON ROWS
    FROM [Adventure Works];
    If you plan to tweek this solution, you may want to align the dimensionality of the [all Subcat] member with the others members by changing its definition:
    MEMBER [Product].[Subcategory].[All].[all Subcat] AS
    aggregate(EXISTING
    [Customer].[State-Province].CurrentMember
    ,[Product].[Subcategory].[All]
    The former defintion also works in our case because it's a singleton set and it is put in a tuple when crossjoined with the axis 1 giving it the right dimensionality.
    Philip,

  • Not exists / union - two dimensions nothing in the fact folder, possible???

    What I am trying to do is (in functional terms) produce an invoices on hold report.
    This has two distinct characteristics - some invoices are coding but on hold (easy - see first part of the SQL below), but some invoices have no coding, nothing in the FACT folder and I need to show two dimension folders which currently only join via the FACT folder - is this possible??
    equivalent SQL =>
    select supp.supplier_name, inv.invoice_number, inv.invoice_amount, dis.amount, code.segment1||'/||code.segment2
    from     AP_INVOICES_MV inv
    ,          ap_suppliers_mv supp
    ,       ap_holds_mv hold
    ,      AP_INVOICE_DISTRIBUTIONS dis
    ,     gl_coding code
    where inv.invoice_key = hold.invoice_key
    and    inv.supplier_key = supp.supplier_key
    and  inv.invoice_id = dis.invoice_id
    and   dis.code_key = code.code_key
    and   hold.holds <> 'No Holds'
    union
    select supp.supplier_name, inv.invoice_number, inv.invoice_amount, 0 amount, 'XXXXX/XXXX' gl_code
    from     AP_INVOICES_MV inv
    ,          ap_suppliers_mv supp
    ,       ap_holds_mv hold
    where inv.invoice_key = hold.invoice_key
    and    inv.supplier_key = supp.supplier_key
    and   hold.holds <> 'No Holds'
    and   not exists
    (select 'x'
    from    ap_invoice_distributions dis
    where dis.invoice_id = inv.invoice_id)
    order by 1, 2, 4 ascMy problems are; -
    1. is that the second part of the union (not exists section) requires me to join two DIMENSION tables without going via the FACT table is this possible?? (If so how - what JOINS would I need on between the FACT and the DIMENSIONS and would this significantly impede running speed generally)
    2. Given that even when writing direct database requests the FROM part of the SQL is the subject area, not the tables, the tool writes the joins for you, how can I write the equivalent of the above??
    n.b.
    AP_INVOICES_MV - DIMENSION
    ap_suppliers_mv - DIMENSION
    ap_holds_mv - DIMENSION
    gl_coding code - DIMENSION
    AP_INVOICE_DISTRIBUTIONS FACT
    With the structure following the classic STAR with all folders described in the dimensions equi joining to the FACT folder, BUT some in the invoices dimension will not have corresponding values in the FACT folder (un-coded invoices).
    With thanks for your input,
    Robert.

    Try this app: http://tyorex.com/iWorkConverter
    Batch convert Pages files to doc and pdf.

  • How to combine two dimension in dashboard??

    Dear experts,
    I have a requirement that i need two combine two dimension in dashboard.
    Ex:-
    -  I have two different providers (Query1 and Query2) and both is having common dimension called Plant.
    - The plant from both query is having different values (for example, Query1 Plant = A,B,C and Query2 Plant = D,E,F,G)
    - Now I want the total list of plants from both query and list of plants will be used as filter on combo box in dashboard.
    Note: List of values for Plant (dimension) may increase or decrease from both query.
    Thanks and regards
    Vijay Muniraj

    Hi Vijay,
    How can you combine the 2 queries as a single query in dashboard?If i understood the query,use a Multiprovider for your requirement and get the combined results in single query and use Plant as single prompt in the dashboard(If you are getting data from BI).You cannot merge this behaviour in the dashboard.(In Web Intelligence you can merge it based on common dimension values only).
    Regards,
    Venkat

  • MaxL / INCBUILDDIM - two dimension limit

    I'm trying to build multiple dimensions in a single MaxL 'import database dimensions' command by including multiple 'from xx using rules_file xx' blocks separated by commas. This syntax is as per the documentation.The reason for building multiple dimensions in a single 'import database dimensions' command, rather than using multiple commands is that this achieves the same effect as the ESSCMD 'INCBUILDDIM', where the database is only restructured after ALL the dimensions have been built.MaxL doesn't error, but it only builds the first two dimensions specified and simply ignores any others! Has anyone seen this issue - I'm wondering if it's a MaxL bug (v6.5.1). I've tried different dimensions, changing the order etc. Always the same - builds the first two, ignores anything else.Thanks..

    Assuming that your AW was defined using AWM or OWB (i.e. it is standard form), then you should find two additional objects related to your dimension -- the INHIER valueset and the HIERLIST dimension. For example, if your dimension is named PRODUCT, then you should find
    DEFINE PRODUCT_HIERLIST DIMENSION READONLY LOCKDFN TEXT
    DEFINE PRODUCT_INHIER VALUESET READONLY LOCKDFN PRODUCT <PRODUCT_HIERLIST>
    (These are 11g definitions -- the 10g versions do not have READONLY LOCKDFN.
    The PRODUCT_HIERLIST contains one member for each hierarchy of the dimension, 'H1' and 'H2' say. To limit the dimension to just members in H2 you can say
    LIMIT PRODUCT TO PRODUCT_INHIER(PRODUCT_HIERLIST 'H2')

  • How to calculate variance between two dimension values

    Hello:
    I have built a cube in Analytical workspace (9.2.0.5) with 3 dimensions. Time, Product & Scenario. I am using BI Beans (thick client) for the presentation layer. What I need is the ability to calculate the variance between two dimension values of same measure. For example, if My scenarios are 'Actual' and 'Budget', when I present the results on the screen for any measure (e.g Total Sales), I should be able to calculate & display the difference between 'Actual' & 'Budget' values of that measure.
    I have more than 7 scenarios and more than 40 measures. It could even be the difference between two product categories. How do I do it either in AW or at BI Beans Level?
    Thank you very much for your help.
    regards
    Suresh

    You want to look at qualified data references in the OLAP DML references. Basically, any data reference may be qualified by specifying a dimension name and value:
    sales(time 'jan92')
    forces the dimension TIME to the member 'jan92', no matter whether 'jan92' is in status or not. The resulting expression is essentially no longer dimensioned by the dimension TIME.

  • Two dimensions, one fact

    Hello guys,
    The last few hours I've been trying to solve the following issue:
    I've got a small dataset which contains three different tables, two dimension tables and one fact table. The first dimension table is a calendar table (for now I will call this table D1), the second dimension table holds locations (named: D2) and the third (fact) table (named: F1) holds invoice data. What I would do normally is build the following model:
    D1 -< F1 >- D2
    This works fine as long as I only want to know the locations where there is invoice data, so far nothing goes wrong.
    But when I want to know for each year (data coming from D1) which locations there were (coming from D2) I only get back results when there is invoice data in F1 (Off course there is a relation between D1 and D2, the column Year).
    I tried to solve this by doing the following things:
    - Use an alias table (of D1) joined to D2
    - Use different join types - this works for the connection between F1 and D2 as long as D1 is not added to the table source
    - Use different datasources in the Business Layer
    - Join D1 to D2 and F1 in the Physical Layer
    But so far I'm stuck with the same problem: I want to query two dimension tables without a fact table removing results when the fact table doesn't contain any data from one of the dimension tables.
    Is there something I'm overlooking or am I asking something that is just not possible?
    Thanks in advanced,
    Dennis

    Hi Dennis,
    so your D2 location dimension also contains a column "Year"? Isn't this a bit strange?
    Anyway.. if this is the case, then you could see table D2 as a logical fact table, with two logical dimensions: D1 and D2.
    Then you can create a measure based on this new logical fact table and use it as an implicit fact in your subject area. By doing this, the BI Server will use table D2 to join D1 and D2 instead of the invoice fact table.
    Regards,
    Stijn

  • ALV table with two dimensions and a link in each cell to a document

    Hi,
    I want to create an ALV output for a 2-dimension table. The table should look like:
    ---  |  Col1  |  Col2  | ...
    L1 | Cell11 | Cell12 | ...
    L2 | Cell21 | Cell22 | ...
    Do you have any hints how I could implement such a two dimensional ALV with different links when clicking on Cell11, Cell12, Cell21, ....
    Thanks for your help!
    Caroline

    if u use OO ALV,
    1.on clicking CELL1, CELL2 etc, to get different links,
    u can put hotspot for the fields in fieldcat
    and u can handle method
    button_click event of cl_gui_alv_grid.
          CLASS LCL_EVENT_RECEIVER DEFINITION
    CLASS LCL_EVENT_RECEIVER DEFINITION.
      PUBLIC SECTION.
        METHODS HANDLE_CLICK_ROW_COL
        FOR EVENT CLICK_ROW_COL OF CL_GUI_ALV_GRID
        IMPORTING ROW_ID COL_ID.
    ENDCLASS.                    "cl_event_receiver DEFINITION
          CLASS CL_EVENT_RECEIVER IMPLEMENTATION
    CLASS LCL_EVENT_RECEIVER IMPLEMENTATION.
      METHOD HANDLE_BUTTON_CLICK.
        perform button_click using ROW_ID COL_ID.
      ENDMETHOD .                    "handle_top_of_page
    ENDCLASS .                    "cl_event_receiver
    2.
    FOR GETTING TWO DIMENSIONS, HANDLE PRINT_TOP_OF_PAGE
    and using write statements, build a row at the top of grid.
    or else
    IN THE LAYOUT , U CAN PLACE BUTTONS JUST ABOVE THE CUSTOM CONTAINER

  • Substitution Variable across two dimensions

    Hello,
    I was wondering if we could define a single substitution variable across two dimensions. For instance, we have two dimensions Year (FY10,FY11,FY12, etc) and Period (QTR1, JAN, FEB, MAR, QTR2...)
    I understand we can define a range of values in a single subvar such as &period is Jan:Dec.
    However, given the above two dimensions we would like something like this Jan.FY10:Dec.FY13. I know this would be easier if years and months belonged to the same dimension but they are two different dimensions. So, essentially we want to define a single subvar involving two dimensions.
    Please let me know, if this is possible on Essbase 9.
    Thank you.
    Edited by: user10678366 on Sep 15, 2010 9:56 AM

    Thanks for all your responses. As Gary and Srinivas pointed out @XRANGE definitely works with a subvar with a few limitations;
    1. Cannot be used in a FIX statement
    2. For accurate months across different years, the order of the subvar should be FY11->FEB, FY13->DEC and not not FEB->FY11, DEC->FY13 since in my db, the Period dimension is DENSE and appears before the YEARS dimension in the outline.
    3. It works in a IF statement
    However one lingering issue I have is with a @PRIOR statement on conjunction with @XRANGE within my IF statement:
    Note: subvar &RANGE = FY11->FEB, FY13->DEC
    STAT1(
    IF(@ISMBR(@XRANGE(&RANGE)))
    IF(STAT1 = 20)
    STAT1 = @PRIOR(STAT1)
    ENDIF
    ENDIF
    The problem is STAT1 gets calculated accurately for all months for that year. However, all months the following year donot get calculated. So, essentially the BEGBALANCE (also at level 0) doesnt get calculated for the next year. Here an illustration of before and after:
              FY11     FY12     FY13
    Stat1     BegBalance               
         Jan     #MI     #MI     #MI
         Feb     #MI     #MI     #MI
         Mar     #MI     #MI     #MI
         Apr     #MI     #MI     #MI
         May     #MI     #MI     #MI
         Jun     20     #MI     #MI
         Jul     #MI     #MI     #MI
         Aug     #MI     #MI     #MI
         Sep     #MI     #MI     #MI
         Oct     #MI     #MI     #MI
         Nov     #MI     #MI     #MI
         Dec     #MI     #MI     #MI
    Stat1     BegBalance     #MI     #MI     #MI
         Jan     #MI     #MI     #MI
         Feb     #MI     #MI     #MI
         Mar     #MI     #MI     #MI
         Apr     #MI     #MI     #MI
         May     #MI     #MI     #MI
         Jun     20     #MI     #MI
         Jul     20     #MI     #MI
         Aug     20     #MI     #MI
         Sep     20     #MI     #MI
         Oct     20     #MI     #MI
         Nov     20     #MI     #MI
         Dec     20     #MI     #MI
    The expected result is:
    Stat1     BegBalance     #MI     20     20
         Jan     #MI     20     20
         Feb     #MI     20     20
         Mar     #MI     20     20
         Apr     #MI     20     20
         May     #MI     20     20
         Jun     20     20     20
         Jul     20     20     20
         Aug     20     20     20
         Sep     20     20     20
         Oct     20     20     20
         Nov     20     20     20
         Dec     20     20     20
    So, essentially though the @XRANGE takes into account BegBalance and calculates for each year based on prior year->dec, which is good. However, introducing the @PRIOR doesnt calculate BegBalance. Looks like I dont have any option other than using @MDSHIFT instead of @PRIOR when it comes to using @PRIOR with @XRANGE.
    Unless I am incorrectly using the @PRIOR statement with @XRANGE. Please suggest.

  • Two dimension array?

    Show me the code for two dimension array in JSP!
    Thanks in advance!

    Hi,
    I am new in Java but maybe I can help you:
    Two-dimnsional arrays you can declare in following way:
    String[][] someArray;
    When you want to allocate space for new array you can do something like this:
    someArray = new String[5][5];
    All Arrays have a data variable called length, which you can inspect to find out how many elements there are in the array.
    For multi-dimensional arrays, each dimension has a length property.
    int[] [] a1 = {{ 0, 1, 2 },{ 3, 4, 5 }};
    for (int i=0; i < a1.length; i++) {
    for (int j=0; j < a1.length; j++) {
    prt(i + "," + j + "=" + a1[i][j]);
    Hope this is of help to you.
    Mirkos

  • Two dimension string array in teststand

    Hello,
    I want to pass a two dimension string array from a labWindows dll into Teststand. My labwindows dll:
    #define NR_columns 12
    #define NR_rows  1200
    #define NR_hight   1024
    int__declspec(dllexport) __stdcall  sort( char pspec[NR_columns][NR_rows][NR_hight])
    The call of the dll in teststand looks like the attached picture in the doc file.
    and I got the error message which shows the attached second picture in the doc file
    what is the problem?
    regards
    samuel
    Attachments:
    Error1.doc ‏94 KB

    Hello Samuel,
    I'm not experienced in LabWindows but I think the reason for this Error is the dimension of FileGlobals.loadspec in TestStand. The Error Dialog displays for this String Array [0..11][0..1200]. That's an array of 12 and 1201 elements but function is expecting 12 and 1200 elements.
    I hope this helps.
    Kind regards
    C. Dietz
    Test Engineering
    digades GmbH
    www.digades.com

  • Selecting one dimension of a two dimension array?

    hi, i want to select only one dimension of an array and put it into an arraylist (or casting the array verbatim into the arraylist)
    for example, here is an two dimension array:
    Object[][] data =
         {  { new Date(), "A", new Integer(1), Boolean.TRUE },
         { new Date(), "B", new Integer(2), Boolean.FALSE },
         { new Date(), "C", new Integer(9), Boolean.TRUE },
         { new Date(), "D", new Integer(4), Boolean.FALSE}
         };and i want to cast it into an arraylist, what i have in mind (a bit troublesome is the following:)
    ArrayList dataArray = new ArrayList();
    dataArray.add(data[0]);
    dataArray.add(data[1]);
    dataArray.add(data[2]);
    dataArray.add(data[3]);
    System.out.println(dataArray);when come upon the last System.out.println, i got some seemly useless addresses:
    [[Ljava.lang.Object;@f73c1, [Ljava.lang.Object;@789144, [Ljava.lang.Object;@1893efe, [Ljava.lang.Object;@186c6b2]
    how do you accomplish casting a two dimension array into an arraylist, but the second dimension of the arraylist is kept as Array of Objects? thanks alot!

    First, the strings that are printed out are the value of the hashcode for the specific object. That is the default value that is printed out for any object reference in a class that inherits the toString() method from the Object class. This is true for arrays. Your ArrayList contains array references in it..
    So, you are printing the object hashcodes for the arrays in your ArrayList, instead of the contents of those arrays. It would be better if you created ArrayLists, or even designed an object that stores your data, and stored those inside your ArrayList. ArrayList has an overwritten toString() method that will print the contents instead of the object hashcode, so an ArrayList containing ArrayLists would print your data the way you want. If you define your own class, you will need to provide a toString() method that prints the contents the way you want.
    PS, look at http://java.sun.com/j2se/1.5.0/docs/api/java/util/AbstractCollection.html#toString() for more information on the toString() method used by ArrayList.
    � {�                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • Invoice per year

    Hello, Iam writing this question as phone to sales in Poland doesnt work, so maybe you might answer my question. Is it possible to get invoice from Azure for all services that Azure will provide in 1 year time span ? Iam asking because Iam preparing

  • Advertisements cover up some of the script on the page and when I type words into the search box, the letters are only half way visible

    On my home page in the Google search box, when you type words the letters are cut off on the bottom. Also advertisements are on top of writing or things I want to see on web pages. == This happened == Every time Firefox opened

  • Unable to print PDF file

    Hi All, I have a printer HP ML1005 installed on my Mac. Printing is fine for all office applications and other applications as well *EXCEPT for PDF file*. Before I can print a PDF file on this printer, but now for no reason I can't print - it stuck o

  • How can I fix this Footage

    Hi all, The Issue So I'm working on this video clip, and I am currently having issues with what I believe might be called over exposure (still learning the nomenclature). If you watch the clip you will notice that from one angle the footage looks muc

  • Issue Screen Scrolling Very Jumpy - How can it be improved?

    I have setup 3 MS Windows Server 2012 R2 Remote Desktop Servers, connecting to Wyse C10LE terminals.  When scrolling in documents the display screen does not do so clearly.  I've tried reducing the encryption level and security settings but still no