To dewangs. How to load all descriptions (lines) into a Vector?

Thank You dewangs!
I am confident that Your second advice to use Vector will solve my problem. But I have two more questions.
Let say I have used BufferedReader(new FileReader(c:/java/MyText.txt)) to read from MyText.txt file. In this case, how to load all descriptions (lines) of this file into a Vector? And how to associate each line of MyText.txt as an element of the Vector?
I am trying to do something, but no results.
try{
BufferedReader reader = new BufferedReader(new FileReader("c:/java/Applications/MyText.txt"));
String str=reader.readLine();
JList myList = new JList();
StringTokenizer st = new StringTokenizer(str,"\n");
Vector vr = new Vector(25);
while(st.hasMoreTokens()){
String nextToken = st.nextToken();
vr.addElement(nextToken);
myList.setListData(vr);
TA1.setText(TA1.getText()+
(String)myList.getSelectedValue());
}catch(IOException evt) {};

My suggestion is to create a new class that has a String (for your line of text) and an Image or ImageIcon for your picture. Store the instances of this class in the vector, and then add the appropriate part of the items in the vector to your list. Then you can just get the item in the vector corresponding the to index of the selected item in the list, cast it to your new class, and grab the String or the image as needed.

Similar Messages

  • How to pre - load all database rows into cache

    Hi All,
    The below is my cache configuration, I would like to know how to load all the database rows/specified number of rows into the cache.
    <?xml version="1.0"?>
    <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
    <cache-config>
    <caching-scheme-mapping>
    <cache-mapping>
    <cache-name>TableEmp</cache-name>
    <scheme-name>distributed-hibernate</scheme-name>
    <init-params>
    <init-param>
    <param-name>entityname</param-name>
    <param-value>com.tangosol.examples.explore.Emp</param-value>
    </init-param>
    </init-params>
    </cache-mapping>
    </caching-scheme-mapping>
    <caching-schemes>
    <distributed-scheme>
    <scheme-name>distributed-hibernate</scheme-name>
    <backing-map-scheme>
    <read-write-backing-map-scheme>
    <internal-cache-scheme>
    <local-scheme></local-scheme>
    </internal-cache-scheme>
    <cachestore-scheme>
    <class-scheme>
    <class-name>
    com.tangosol.coherence.hibernate.HibernateCacheStore
    </class-name>
    <init-params>
    <init-param>
    <param-type>java.lang.String</param-type>
    <param-value>{entityname}</param-value>
    </init-param>
    </init-params>
    </class-scheme>
    </cachestore-scheme>
    </read-write-backing-map-scheme>
    </backing-map-scheme>
    </distributed-scheme>
    </caching-schemes>
    </cache-config>
    Please kindly provide a solution.
    Regards
    S

    Hi Rich,
    Imagine I have just downloaded coherence, I have run a server with the default config. From what you said to S coherence can pull the data from database itself WITHOUT me having to push it to coherence? If so can you please explain how this done, or point me at a guide?You might start with [Read-Through Caching|http://coherence.oracle.com/display/COH34UG/Read-Through%2C+Write-Through%2C+Write-Behind+and+Refresh-Ahead+Caching#Read-Through%2CWrite-Through%2CWrite-BehindandRefresh-AheadCaching-ReadThroughCache] to understand how Coherence can pull data. It is the implementation of a CacheLoader that enables the Coherence cache to pull the data.
    The cache configuration that S provided specifies a read-write-backing-map-scheme indicating that HibernateCacheStore class should be used by Coherence and is similar to the configuration discussed at [Using Hibernate as a CacheStore for Coherence|http://wiki.tangosol.com/display/COH34UG/Using+Hibernate+as+a+CacheStore+for+Coherence]. In responding to the original question, I was assuming that the data source being queried to be loaded into the cache is the same as the data source fronted by the Hibernate configuration.
    Secondly with the respects to the answer to my question. If I don't care about versioning ... do I need a EvolvablePortableObject? If you really don't want to version your serialized representations, you can implement the PortableObject interface instead but the additional cost of implementing EvolvablePortableObject is small and the potential benefit is great.
    So my question is, can coherence pull the data from the database using a preload request and serialize into a pof format without me having to push the data to coherence via a separate app? And if so could you please explain how? Or direct me at some documentation?You do not need to push data to Coherence via a separate app. Coherence can pull the data from the database. Coherence can also preload the cache using an EntryProcessor. You can configure Coherence to use POF and will need to implement POF serialization methods for your cache objects.
    The [Partitioned cache with a serializer|http://coherence.oracle.com/display/COH34UG/Sample+Cache+Configurations#SampleCacheConfigurations-Partitionedcacheofadatabase] example and the links it provides should provide sufficient documentation for configuring and using POF.
    Whether you decide to use the HibernateCacheStore, the TopLinkCacheStore or implement your own CacheStore or CacheLoader class to access your data in your database is your decision. You should be able to find sufficient documentation and examples to help you decide how you would like to use Coherence at the [Coherence Knowledge Base|http://wiki.tangosol.com/display/COH/Oracle+Coherence+Knowledge+Base+Home]. I would recommend starting with the [User Guide|http://wiki.tangosol.com/display/COH34UG/Coherence+3.4+Home] if you would like to get a better grasp of the overall architecture.
    Regards,
    Harv

  • TS3212 ITunes worked fine on my Windows 7 machine.  Had to rebuild the machine but all the data remains.  Downloaded a new version of iTunes and cannot figure out how to load all of my music currently on my hard drive.  Tried moving Library file.  Did not

    ITunes worked fine on my Windows 7 machine.  Had to rebuild the machine but all the data remains.  Downloaded a new version of iTunes and cannot figure out how to load all of my music currently on my hard drive.  Tried moving "iTunes Library" file.  Did not work.  Never had trouble like this before.

    Many thanks for your post. I've been trying for days to get this sorted and was getting well fed up with I-Tunes. Really thought i'd never get it working again. Tried un-installing it, loading older versions and they still wouldn't work.
    Came across your suggestion by chance and top man - it worked..!!!!
    How you even knew what to do is beyond me - but thanks so much. I really was pulling my hair out.
    You need to put your post over the Web as there seem to be loads of people having the same trouble.
    Thanks again.

  • How to load Essbase member formula into DRM using Automator

    Hi,
    I just wonder how to load Essbase member formula into a member property in DRM?
    I encounter a problem when loading a member formula which as new line in the formula.
    Here is the example of the record for Automator using | (pipe) delimiter where the formula has carriage return / new line:
    ChangeProp|Master|Accounts|CYTDSignOnBonus|ESB_Formula|[OpenInputValueBlock]
    [CYTD("Sign On Bonus")]
    [CloseInputValueBlock]
    In the above example. when the formula is loaded, it only load the 1st line and strip the remaining line.
    Thanks.

    Hello,
    I have encountered this issue as well and here is how I receommend you deal with it. Unfortunately, DRM does not understand multiple lines in a formula and so it truncates the other lines.
    1. The best way around it is to ensure that your formula does not have multiple lines. Strip all the enters and only use spaces. Essbase does not care about aesthetics as long as the formula is all in one line. This should take care of it.
    2. Sometimes, the formulas for member properties are very long and they are in multiple lines. You can try using excel formulas to bring them all in one line. After removing enters and tabs myself multiple times, I informed my Essbase developers of this DRM issue and told them to provide me with the formulas without using Enters and tabs.
    Hope this helps.
    -- Adi

  • How to load Matrix report data into basic table data using ODI

    Hi,
    How to load Matrix report data into basic table data using oracle Data Integrator ?
    Requirement Description:
    Following is the matrix report data:
    JOB                       DEPT10                DEPT20 
    ANALYST                                           6000
    CLERK                   1300                     1900 Need to convert it into below format:
    JOB                             Dept                        Salary
    ANALYST                  DEPT10     
    ANALYST                  DEPT20                     6000
    CLERK                       DEPT10                    1300
    CLERK                       DEPT20                    1900
        Thanks for your help in advance. Let me know if any further explanation is required.

    Your list seems to be a little restrictive, you can do a lot more with ODI procedures.
    If you create new procedure, and add a step. In the 'command on source' tab set you technology and schema as per your source database. Use the unpivot functionality as described in the link, please, rather than using 'SELECT *' use the appropriate column names and alias them for eg:
    SELECT job as job,
    deptsal as deptsal,
    saldesc as saledesc
    FROM pivoted_data
    UNPIVOT (
    deptsal --<-- unpivot_clause
    FOR saldesc --<-- unpivot_for_clause
    IN (d10_sal, d20_sal, d30_sal, d40_sal) --<-- unpivot_in_clause
    Then in your 'command on target' tab set the technology and schema to your target db, then put your INSERT statement for eg:
    INSERT INTO job_sales
    (job,
    deptsal,
    saledesc
    VALUES
    :job,
    :deptsal,
    :saledesc
    Therefore you are using bind variables from source to load data into target.
    Obviously if the source and target table are in the same database, then you can have it all in one statement in the 'command on target' as
    INSERT INTO job_sales
    (job,
    deptsal,
    saledesc
    SELECT job as job,
    deptsal as deptsal,
    saldesc as saledesc
    FROM pivoted_data
    UNPIVOT (
    deptsal --<-- unpivot_clause
    FOR saldesc --<-- unpivot_for_clause
    IN (d10_sal, d20_sal, d30_sal, d40_sal) --<-- unpivot_in_clause
    also set the log counter as 'Insert' on the tab where your INSERT statement is, so you know how many rows you insert into the table.
    Hope this helps.
    BUT remember that this feature only came out in Oracle 11g.

  • How to load BeginningBalance and movements into HFM via FDM from ERPI

    I have a file generated by ERPI with the columns of |AMOUNT|BEGIN_BALANCE_DR|BEGIN_BALANCE_CR|PERIOD_NET_DR|PERIOD_NET_CR|
    among many other columns.
    How can load them via FDM into the Custom1 dimension in HFM, which contains BeginningBalance, Additions, Disposals, etc.
    So basically I will have a trial balance, which I can compare with GL and OBI.

    Hello
    You can use the IDOC SOPGEN01 for that purpose.
    Please check transaction WE60 for IDOC documentation and there are many old threads with information about this IDOC.
    BR
    Caetano

  • How to load the google map into an empty movieclip

    how to load the google map into an empty movieclip ?  Thank you

    if you're using as3, check the google maps api for flash.  if you're using as2, check the google maps api for javascript and use the externalinterface class in flash.

  • How to load data from Quikbooks into PeopleSoft General Ledger module ?

    Folks,
    Hello.
    My client's data is currently stored in Quikbooks.
    After install PeopleSoft FSCM 9.0, I need to load the data from Quickbooks into PeopleSoft General Ledger module. But I don't know how to use PeopleSoft Integration Broker to integrate with Quikbooks.
    Can any folks tell me how to load data from Quikbooks into PeopleSoft General Ledger module ?

    Hi,
    If the data load is one time process, then you can use PL/SQL or datamover to load the data to PeopleSoft application.
    If you want to load the data in real time, then you need to create In-bound and out-bound nodes to perform the transaction.
    Thanks
    Soundappan

  • How to load budgeted sales dollars into SAP.

    hello experts
    we are using ecc 5.0
    pl advise how how to load budgeted sales dollars into SAP
    thnks
    vinod

    Hello,
    Budgets are like threshold figures where your actuals cannot exceed your budgets.
    Whereas, planned data is for variance analysis with your actuals.
    You can configure the cost center planning so that the user can upload the data through KP06 or KP26
    This is controlled by planning are in your planning profile. You need to use "Cost ctrs: Cost element/activity inputs" planning area for this purpose.
    Hope you are conversant with Integrated excel upload.
    To do integrated excel upload of cost center plan data.
    IMG ==> Controlling ==> Cost Center Accounting ==> Planning ==> Manual Planning User Defined Layouts - Create your own layout or copy from standard layout and change it.
    IMG ==> Controlling ==> Cost Center Accounting ==> Planning ==> Define User Defined Planner Profiles
    Copy the SAPALL to ZSAPALL. You cannot change SAPALL as it is standard.
    In ZSAPALL planner profile, select proper planning area and enter your layout.
    Tick Integrate Excel.
    Once the popup for KP06 comes, you need enter the data and save it. It would generate the file name.
    With the same file name you need upload the plan data by using KP06.
    In KP06
    Extras ==> Excel Planning ==> Upload
    Select the file as prepared in accordance with format at the time of generating the file name.
    Hope this solves your problem.
    Please let me know if you need futher help.
    Regards,
    Ravi

  • How to load the certificate authority into the keystore for the weblogic8.1

    how to load the certificate authority into the keystore for the weblogic8.1
    ==================================================
    Getting the message below when trying to improt the certificate to the weblogic 8.1 web server. Received this certificate from our internal IT certificate authority. Trying to import the certificate to our test sytem.
    ===================================================
    keytool error: java.lang.Exception: Failed to establish chain from reply
    Import failed. Verify that the Certificate Authority that signed 'certi.pem'
    has been loaded into your keystore 'keystore\pskey'
    To view keystore contents issue 'PSkeymanager -list -keystore keystore\pskey [-v
    To preview a certificate file issue 'PSkeymanager -previewfilecert -file certi.pem'

    You need to populate that field using cmod code. Find out from which table that field is and go to transaction cmod then enter project name and select component radio button then display.
    Now select the FM EXIT_SAPLRSAP_001  if your datasource is transactional dataource
    EXIT_SAPLRSAP_002 for master data attibute
    EXIT_SAPLRSAP_003 for Hierarchies
    EXIT_SAPLRSAP_004 for text
    then populate code .
    After your code then delete data from ods then reinit to populate the enhanced field.
    Hope it helps..

  • How to get ALL command line parameters

    Hi,
    Is there possibility to get all command line parameters which
    Flex builder invokes when I press RUN button ?
    I am asking because I want to create mxmlc ant task with the
    same parameters as Flex builder.
    I wrote something like that below but I have a problem with
    invoking remote function, it seems that poduced SWF inf flex
    builder an my script (below) arent the same - and mayby have some
    security differences.
    Any Ideas how to get all compiler argumets from flex builder
    quote:
    <mxmlc
    file="${flex.src}\main.mxml"
    output="${flex.output}\main.swf"
    services="${path.tomcat.root.WEB}/flex/services-config.xml"
    context-root="${path.tomcat.root}"
    use-network="true"
    keep-generated-actionscript="false"
    debug="false"
    locale="en_US"
    incremental="true"
    >
    <!--load-externs="${LOADEXTERNS}"
    link-report="link-report.xml" -->
    <load-config
    filename="${FLEX_HOME}\frameworks\flex-config.xml"/>
    <source-path path-element="${FLEX_HOME}\frameworks"/>
    <compiler.source-path path-element="${flex.src}"/>
    <compiler.library-path dir="${FLEX_HOME}\frameworks"
    append="true">
    <include name="libs" />
    <include name="../bundles/{locale}" />
    </compiler.library-path>
    </mxmlc>

    Hi,
    Try -dump-config compiler argument, which will write all the
    currently set configuration values. Please find more details at the
    URL below.
    http://www.quilix.com/node/9
    Hope this helps.

  • How 2 read all the line of a sales order text ID plz

    Dear all
    I have the following to read sales order text of single line of limited char(40)
      TIDNO = '0003'.
        CONCATENATE SSORD
                    LIPS-POSNR
        INTO        TNAME.
        TOBJT = 'VBBP'.
        PERFORM FINDTEXT.
        LOOP AT MSLINES.
          WA_ITEM-PACKTYP = mslines-tdline(40).
          EXIT.
        ENDLOOP.
      How do i read mutiple lines plz tell me ?
    Thnx
    Moni
    Message was edited by: md monirujjaman

    Hi Md,
    sorry I don't understand your question, can you explain more ?
    Regards
    Frédéric

  • I just bought a new Ipod classic 160gb.  I was able to load my songs ok but I don't know how to load all of my playlists.  Can someone tell me how to do it?

    I just bought a new Ipod classic 160gb.  I was able to load all of my songs onto it but I can't seem to get all of my playlists onto it.  Can someone tell me how to fo it?

    You'll need to contact Apple then for help on resetting some of that account information.
    http://www.apple.com/contact/
    B-rock

  • How to load all the classes in a JAR file at runtime?

    Any clues o:
    "How can I force JVM to load all the classes in a specified JAR at once?"
    Thanx!
    -Rajeev

    Well I was thinking may be there exists an option with "java", when I
    am starting an application from a jar file, I could force it to load all
    the classes in the JAR. I don't want to do it programically. Is there such
    an option available?? Or in other words can I ask JVM to not do the dynamic
    loading for the JAR??
    Thanx.
    List all JarEntries and convert the paths to fully
    qualified class files
    e.g file in jar
    [1] /com/mycompany/proj/X.class
    should become
    [2] com.mycompany.proj.X
    then for each entry issue
    Class.forName( [2] );

  • How to load 4x6 photo paper into a hp office jet # j6480 All-in-one​?

    how do i load 4x6 photo paper into a hp  office jet # j6480 All-in-one?

    Hi jdz198,
    You will load the photo paper face-down on the right side of the paper tray. Here is a document to follow.
    If I have solved your issue, please feel free to provide kudos and make sure you mark this thread as solution provided!
    Although I work for HP, my posts and replies are my own opinion and not those of HP.

Maybe you are looking for

  • SSRS Reporting

    Hi there, Please assist, i'm unable to connect to oracle database via oracle client 11. It was working fine before we had hardware failure on the server. Error i'm getting when running the report on the report server: An error occurred during client

  • None of the menubar links (Options, Content, Logout, etc.) or Channel bar links (Edit, Minimize, Maximize,etc.) work anymore.

    They suddenly quit working for all domains. When the link is clicked on, it just "refreshes" to itself. I even created a new domain with all the default settings. When I do a search on the portal server for the providers that are being called, I get

  • Sales order Customer Requested Delivery Date

    Hi Experts We are getting date difference of Customer Requested Delivery Date in MD04 and Product View for one customer. Scenario: Created Sales order by giving CRD date as 26.07.2010 and In APO Product View the same sales order shows 25.07.2010. Ple

  • Calc Manager in OBIe / URL

    Hi everyone, I have two questions about calc manager: 1) Is't possible to run calc manager scripts through OBIE? 2) Is't somehow possible to get to specific calc manager script using URL? Thanks in advance, Sergey

  • How can i turn off 3g service on a 4s

    how can i turn off 3g service on a 4s?,there are times when i don't want to use my 3g data alowance and would like to restrect it to wi-fi only,can the 3g be turned off and on as needed?