Multiple related columns in JList

Is it possible to have multiple columns in a JList?
My problem is that I have a class called Volunteer who have a name, surname and id number.
I would like these to be displayed in a JList like:
name surname id
name surname id
and so on...
I have currently managed to get the volunteers names displayed in a scrolling list, but can't seem to find how to add the surname and id fields to them.
Is there anyone who knows (or has any idea) of how to do this? - Please help!!

Hi,
that can be done several way:
1. create a cellrenderer for the JList which renders a string like "name,surname,id" to 3 labels with name, surname and id in it so, that the columns are placed correctly one above or below the other.
2. use that JComponent, that is designed for that purpose - a JTable - instead
greetings Marsian

Similar Messages

  • Issue in FDM Import script for ading multiple amount columns.

    Hi,
    I am trying to import the Multiple amount columns to be addedd and imported as one amount column.Below is the script I am using for the same,script is getting verified in Script editor but When I am trying to Load the File I am gettig an error as below.
    ERROR
    Code............................................. 9
    Description...................................... Subscript out of range
    Procedure........................................ clsImpProcessMgr.fLoadAndProcessFile
    Component........................................ upsWObjectsDM
    Version.......................................... 1112
    Thread........................................... 8380
    Scirpt
    Function Import_YTD(strField, strRecord)
    'Set variables
    dim strCurmnth1
    dim strCurmnth2
    dim strCurmnth3
    dim strCurmnth4
    dim strCurmnth5
    dim strCurmnth6
    dim strCurmnth7
    dim strCurmnth8
    dim strCurmnth9
    dim strCurmnth10
    dim strCurmnth11
    dim strCurmnth12
    dim strCurAmount
    strCurmnth1 = Trim(DW.Utilities.fParseString(strRecord, 20, 9, ","))
    strCurmnth2 = Trim(DW.Utilities.fParseString(strRecord, 20, 10, ","))
    strCurmnth3 = Trim(DW.Utilities.fParseString(strRecord, 20, 11, ","))
    strCurmnth4 = Trim(DW.Utilities.fParseString(strRecord, 20, 12, ","))
    strCurmnth5 = Trim(DW.Utilities.fParseString(strRecord, 20, 13, ","))
    strCurmnth6 = Trim(DW.Utilities.fParseString(strRecord, 20, 14, ","))
    strCurmnth7 = Trim(DW.Utilities.fParseString(strRecord, 20, 15, ","))
    strCurmnth8 = Trim(DW.Utilities.fParseString(strRecord, 20, 16, ","))
    strCurmnth9 = Trim(DW.Utilities.fParseString(strRecord, 20, 17, ","))
    strCurmnth10 = Trim(DW.Utilities.fParseString(strRecord, 20, 18, ","))
    strCurmnth11 = Trim(DW.Utilities.fParseString(strRecord, 20, 19, ","))
    strCurmnth12 = Trim(DW.Utilities.fParseString(strRecord, 20, 20, ","))
    If strCurmnth1="" Then strCurmnth1="0" End If
    If strCurmnth2="" Then strCurmnth2="0" End If
    If strCurmnth3="" Then strCurmnth3="0" End If
    If strCurmnth4="" Then strCurmnth4="0" End If
    If strCurmnth5="" Then strCurmnth5="0" End If
    If strCurmnth6="" Then strCurmnth6="0" End If
    If strCurmnth7="" Then strCurmnth7="0" End If
    If strCurmnth8="" Then strCurmnth8="0" End If
    If strCurmnth9="" Then strCurmnth9="0" End If
    If strCurmnth10="" Then strCurmnth10="0" End If
    If strCurmnth11="" Then strCurmnth11="0" End If
    If strCurmnth12="" Then strCurmnth12="0" End If
    'Calculate the YTD Amount
    strCurAmount = CDbl(strCurmnth1) + CDbl(strCurmnth2) + CDbl(strCurmnth3) + CDbl(strCurmnth4) + CDbl(strCurmnth5) + CDbl(strCurmnth6) + CDbl(strCurmnth7) + CDbl(strCurmnth8) + CDbl(strCurmnth9) + CDbl(strCurmnth10) + CDbl(strCurmnth11) + CDbl(strCurmnth12)
    Import_YTD =strCurAmount
    End Function

    Hi,
    how many columns has your file?
    that error means you are trying to access an invalid position.
    Regards

  • How to load data into Planning/Essbase from multiple data column

    Dear All,
    I have a interface file which contains multiple data column as follows.
    Year,Department,Account,Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec
    FY10,Department1,Account1,1,2,3,4,5,6,7,8,9,10,11,12
    FY10,Department2,Account1,1,2,3,4,5,6,7,8,9,10,11,12
    FY10,Department3,Account1,1,2,3,4,5,6,7,8,9,10,11,12
    I created a data rule to load these interface file.
    I want to use ODI to upload this interface. I try to specify the rule name in ODI and run the interface.
    But, it came out following errors.
    2010-02-22 11:40:25,609 DEBUG [DwgCmdExecutionThread]: Error occured in sending record chunk...Cannot end dataload. Analytic Server Error(1003014): Unknown Member [FY09,032003,910201,99,0,0,0,0,0,0,0,0,0,0,0,0] in Data Load, [1] Records Completed
    Any idea to fix the column, I sure the member name is correct as I can load data from data load rule correctly.
    Thanks

    Dear John,
    I updated the data load rule delimter to "," and found different error message as follows.
    'A910201.99','HSP_InputValue','HKDepart','No_WT','032003','NO_Lease','FY09','Actual','Final','Local','0','0','0','0','0','0','0','0','0','0','0','0','Cannot end dataload. Analytic Server Error(1003014): Unknown Member [0] in Data Load, [1] Records Completed'
    It seems that the data load rule can recognize the some member except the figures of Jan to Dec..
    thanks for your help

  • How to do the multiple-line String at JList? help!

    i need some code to multiple-line String at JList.
    i know that it is can be done by html code.
    example:
    <p>line1</p><p>line2</p>
    but if i use that html code...
    i face another problem to my JList..
    it cannot set the font use the ListCellRenderer..
    like:
    public Component getListCellRendererComponent(
    JList list,
    Object value,
    int index,
    boolean isSelected,
    boolean cellHasFocus)
    Color newColor = new Color(230, 230, 230);
    setIcon(((DisplayItem)value).getIcon());
    setText(((DisplayItem)value).getChat());
    setFont(((DisplayItem)value).getFont());
    setBackground(isSelected ? newColor : Color.white);
    setForeground(isSelected ? Color.black : Color.black);
    if (isSelected) {
    setBorder(
    BorderFactory.createLineBorder(
    Color.red, 2));
    } else {
    setBorder(
    BorderFactory.createLineBorder(
    list.getBackground(), 2));
    return this;
    all my JList will be html type...
    i don't want that happen..can be another method to do that multiple-line String in JList??
    i also need to set a icon image between string in the JList. anyone get idea??
    i need ur help!
    thank you.

    I think you should create/override several methods like setText(String), setIcons(Icon[]), paintComponent(Graphics), getMinimumSize(), getPreferredSize(), etc.
    I would like to code like below...:class MultilineLabel extends JLabel {
        private String[] text = null;
        private ImageIcon[] icons = null;
        public void setText( String newText ) {
            // It overrides JLabel.setText( String )
            // Tokenize newText with line-separator
            // and put each text into the 'text' array.
        public void setIcons( Icon[] newIcon ) {
            // It is similar to JLabel.setIcon( Icon ) method,
            // but it receives an array of Icon-s. Set these icons to 'icons' variable.
        public void paintComponent( Graphics g ) {
            // It overrides JComponent.paintComponent( Graphics ) method.
            super.paintComponent( g );
            if ( text != null && icons != null ) {
                int icon_x = 0;
                int text_x = 0;
                int y = 0;
                // draw customized content..
                for ( int i=0; i<text.length; i++ ) {
                    // compute x and y locations
                    // icon_x = ...
                    // text_x = ...
                    // y = ...
                    // and draw it!
                    g.drawString( text[ i ], text_x, y );
                    icon[ i ].paintIcon( this, g, icon_x, y );
        public Dimension getMinimumSize() {
            int width = super.getMinimumSize().width;
            int height = ... // I think you must compute it with 'text' and 'icons'' arrays.
            return new Dimension( width, height );
        public Dimension getPreferredSize() {
            int width = super.getPreferredSize().width;
            int height = ...
            return new Dimension( width, height );
    }I think that code-structure above is the minimum to implement your requirements. (Of course if you want to implement it :)
    Good luck and let me know it works or not. :)

  • How to export UDF and related columns?

    Hi All,
    how to export related UDF columns? When we do export of User.xml and import on fresh copy of OIM we do not have related column. I can not find correct option in deployment manager to export User DF. How to achieve this?
    Best
    mp

    bbagaria wrote:
    I had burned my hands with OIM 11G UDFs import/export. I would suggest manual create when you are moving to a new environment. Again UDFs have clashes with connectors etc and I have few SRs for those.
    HTH,
    BBI've managed to tame UDF attributes and categories for users and organizations using the ConfigManager service. But beware: in 11.1.1.3 it works for the USR table only, you need 11.1.1.5 to deal with organizations.
    See here for some hints:
    http://idmclub.wikidot.com/configservice-service

  • Multiple Data Columns in one report column

    How do I list multiple columns returned from a select vertically within one report column. For instance, I have three statuses for a project that I want to list, I'd like to list the three statuses within one status column. I remember seeing this somewhere but cannot find it now. Example:
    Status Column
    Budget: Green
    Schedule: Red
    Issues: Yellow

    additionally you could use HTML expressions. When editing your report, click on the column you want to use for displaying multiple data columns. This will take you to the report columns attributes page, there you can type in something like the following into the HTML expression field, referencing other report columns using #COLUMN_NAME# substitutions:
    #BUDGET#
    #SCHEDULE#
    #ISSUES#
    this is assuming your column aliases are named BUDGET, SCHEDULE and ISSUES. You can then just hide the columns that you don't want to see because the data is already shown using the HTML expression.
    Regards,
    Marc

  • Displaying data from multiple table/column

    hello ..
    anybody can help me how to diplaying data from multiple table/ column in PHP. TQ

    Follow the "How do I SELECT, INSERT, UPDATE and DELETE data from PHP?" example from http://wiki.oracle.com/page/PHP+Oracle+FAQ and change the "select ..." query to your favourite join, e.g.
    select country_name, region_name from countries, regions where countries.region_id = regions.region_id;

  • Question on Multiple Date columns

    Hello all,
    I have like 7 to 10 fact tables . In each fact table I have one date column..Some facts have 2 or 3 date columns
    for example , I have Activations Fact table in which I have Disconnect_Date and Activation_Date...both should be joined to Date_Dim
    Since , I can't join 2columns from one table to single Date Dim on date_key . I created a alias for Date dim , 1 for Activation_date and the other for Disconnect_date
    Some other fact tables have only one date column . So, i joined all of them to single Date Dim
    Now , In the subject area I will have some facts joined to one Date Dim and Some facts which have multiple date columns joined to their particular alias Date dims...
    like ....
    Subject Area:
    Fact1 (with single date column joined to Date Dim)
    Fact2 ( " )
    Fact3 ( " )
    Fact4 ( " )
    Date Dim (joined to fact1,2,3,4)
    ActivationsFact5 ( fact with 2 date columns)
    Activation_Date ( joined to activationsfact5 on activation_date)
    Disconnect_Date ( joined to activationsfact5 on disconnect_date)
    I have like this...As I know which date dim is joined to what fact I can create reports
    But other users who doesnt have idea on it...may create a report joining activationsfact with Date Dim ,which are not joined
    To avoid this condition , the only way I see is to create aliases of Date Dim for all the facts like Fact1,Date Dim1,Fact2,Date Dim2 like that
    But , I am concerned about creating so many date dims in the rpd. And creating hierarchies for them.
    Does anyone have idea on how to handle this ?? Please help
    Thanks,
    Siri

    Instead of creating aliases of Date Dim for every fact table , do u think its better to train users ?

  • Loading multiple data columns in reserved sign

    Hello,
    Is there a setting to load multiple data columns in reserved sign?
    Thanks,

    Hi Liana,
    To use that formula, you should use CONVERTAMOUNTWDIM  option.
    This options default value is Account dimension but if you want to use different dimension, you should use that dimension name. I guess Building A_65432 is not an account member then you should use below option in the transformation file.
    CONVERTAMOUNTWDIM = dimension name
    This option specifies which dimension to look at for value calculations. You must specify a dimension conversion sheet using the Amount Conversion option. For more information about conversion files, see Data Conversion Maintenance. If there is no formula in the Formula column of the Amount conversion sheet, this parameter has no effect. For example, if the Formula column has the following formula: <value>1.10, all accounts are increased by 10% during the conversion.
    I hope it will help you.
    Regards,
    James Lim

  • SQL Calendar using multiple date columns

    Is there any way to have a Calendar look at more than one date column? I know that it is possible to have the calendar based on a range/interval, but I need to display multiple date columns e.g. Marketing Start Date and Sales Start Date. In the Calendar component it seems possible to only choose one 'Date Column'. Has anyone come across this or know of any workaround?

    Is there any way to have a Calendar look at more than one date column? I know that it is possible to have the calendar based on a range/interval, but I need to display multiple date columns e.g. Marketing Start Date and Sales Start Date. In the Calendar component it seems possible to only choose one 'Date Column'. Has anyone come across this or know of any workaround?

  • ORA-1461 with multiple NVARCHAR2 columns

    Hi,
    I use version 10.2.0.1 version of ojdbc with an Oracle9i database and get ORA-1461 (can bind a LONG value only for insert into a LONG column) when updating multiple NVARCHAR2 columns in the same table.
    What is strange is:
    if I set column1=value1 and column2 null it works
    if I set column2=value2 and column1 null it works
    But if i set column1=value1 AND column2=value2 I have this exception.
    I assume that because using UTF8 I can have an exception for one column if less than 4000 because of nb bytes used by one character but can't understand why different columns sizes interact...
    Database parameters :
    NLS_CHARACTERSET AL32UTF8
    NLS_NCHAR_CHARACTERSET     UTF8
    NLS_LENGTH_SEMANTICS     BYTE
    NLS_NCHAR_CONV_EXCP     FALSE (don't know if usefull)
    Can anyone tell me out to make it work ?
    I tried with driver 10.2.0.3 and have the same issue.
    Thanks for your help.
    Message was edited by:
    user610168

    Hi,
    I use version 10.2.0.1 version of ojdbc with an Oracle9i database and get ORA-1461 (can bind a LONG value only for insert into a LONG column) when updating multiple NVARCHAR2 columns in the same table.
    What is strange is:
    if I set column1=value1 and column2 null it works
    if I set column2=value2 and column1 null it works
    But if i set column1=value1 AND column2=value2 I have this exception.
    I assume that because using UTF8 I can have an exception for one column if less than 4000 because of nb bytes used by one character but can't understand why different columns sizes interact...
    Database parameters :
    NLS_CHARACTERSET AL32UTF8
    NLS_NCHAR_CHARACTERSET     UTF8
    NLS_LENGTH_SEMANTICS     BYTE
    NLS_NCHAR_CONV_EXCP     FALSE (don't know if usefull)
    Can anyone tell me out to make it work ?
    I tried with driver 10.2.0.3 and have the same issue.
    Thanks for your help.
    Message was edited by:
    user610168

  • How to read and write data in to a specified range of cells(it include multiple row & columns) in excel

    How to read and write data in to a specified range of cells(it include multiple row & columns) in excel

    CVI Comes with a sample project that explains how to read/write to a Excel file: choose "Explore examples..." in CVI welcome page and navigate to <cviSampleDir>\activex\excel folder where you can load excel2000dem.prj.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • How do you import CSV, tab, and OFX files into multiple Numbers columns

    This Apple function from Numbers '08 Help "Importing a Document" does not seem to work:
    "You can create a new Numbers spreadsheet by importing a document created in Microsoft Excel or AppleWorks 6. Numbers can also import files in comma-separated value (CSV) format, tab-delimited format, and Open Financial Exchange (OFX) format."
    No amount of experimenting with Import, Export, Save As, Paste and Match Style, or using other applications will enable importing CSV, tab, or OFX files into multiple Numbers columns. Instead, all data is imported into a single Numbers column, which then has to be manually and tediously parsed one data element at a time into columns, one row, and one column at a time.

    Jerrold Green1 wrote:
    Joe,
    They all have worked here. I'm not presently able to try in Numbers 08, but I know I've done them all.
    Just double-clicking a .csv file will open Numbers and display the data in a table. Dragging a .csv file to your Numbers icon on the Dock will open it as a Numbers table. Dragging it to a Sheet in an open Numbers document will make a new table in an existing document, and dragging to a table will insert the csv file into the table you dropped it into.
    CAUTION
    With Numbers '08, CSV files must use the comma as delimiter on every setting of decimal separator.
    Numbers '09 behave differently.
    With your tab-delimited file open in a word processor, copy it, then paste it into a table in an open Numbers document. When doing this, select a cell in the table, but don't double-click into the text field of the cell, then paste.
    Why use this long road when we may import directly Tab Separated Values file (tsv.txt) with Numbers '08 (or '09) ?
    Yvan KOENIG (VALLAURIS, France) jeudi 2 décembre 2010 21:05:36

  • Data Modeler 3.0 EA1 - Logical= Attributes & Relational= Columns missing

    Hi,
    I imported Modeler 2.0 design into Modeler 3.0 EA1 and discovered that LOGICAL=>ATTRIBUTES and RELATIONAL=>COLUMNS options are no longer displayed.
    Were these options removed from this new version or is my installation broken?
    Thanks
    Chiedu

    Hi Chiedu,
    they are removed. Your version is ok - at least for that :).
    Philip

  • Relative column width

    Our company use one OBIEE - dashboard with several tables. The dashboards are watched at different monitors with a different resolutions.
    The outlining of the columns is on each screen diffenrent. Is it possible to make relative columns widths so that the outling of the rables is on each monitor the same?
    kind regards
    Alexander

    I have found changing column widths one of the most frustrating aspects of building Dashboards. In the Additional Formatting Options section on the Style tab of the column in Criteria you wish to change, you can add a percentage (relative) or an actual number (absolute) to attempt to control the width of columns. To change where the report appears within a section of the Dashboard -- (which you seem to be talking about from your description) -- you need to change the horizontal alignment. In Results, click on the Format View button and you can play with the horizontal alignment there.
    The final suggestion I can offer and I have done this to control how reports appear when they are side-by-side, is to build a "padding" report. Basically, I build a report with just the Narrative View. A dummy column with a CASE statement tricks OBI and putting in HTML spaces creates the "buffer." The more spaces the "wider" the report and the more it "pushes" the other reports to where I want it to appear. (This is especially useful when you have two links, horizontally, on the dashboard and you wish them to appear on the left side (easier to see on smaller monitors). The default puts them too much to the middle of the dashboard, perhaps what you are experiencing. I may be wrong. Query again if you wish more details on how to do this.

Maybe you are looking for

  • Creating a CSV file from a pl/sql procedure

    Hi Everyone, I would like to know how to write a procedure in pl/sql where i need to check if they are any records in a table say "Table A". If they are any records in the "Table A" then we need to write those records in the "Table A" to the CSV file

  • Hiding a field in ALV Display

    Hi Experts, How can we hide a field in the ALV Dipslay.

  • HP Officejet 6500A Plus

    My HP Officejet 6500A Plus all in one printer recently stopped functioning and printing.   First the Wireless network stopped working (Wireless Status Disconnected) and the Wireless Netwok Test Report advice was "contact HP support".  Then I started

  • Reset Keyboard Prediction​s & Suggestion​s?

    Does the keyboard predictions and suggestions feature have a memory?  If so, I would like to reset it but can't find anything about it in settings or in help to indicate whether or not this can be done.  It seems seems to have a memory and suggests o

  • How to restart base station via SNMP ?

    How to restart airport extreme via SNMP, with snmpwalk for example ? I can get a lot of information from base station with snmpwalk and airport-mib but still mystery what to poke when I want reboot base station over network.