How to get String out of  void method

I have a problem to get String out of void method. I override method actionPerformed(), and I need to use String from this method in other methods. I get nothing in smth. Can anyone help me with this.
class
StringBuffer smth = new StringBuffer();
StringBuffer s;
      public void actionPerformed(ActionEvent event){
          String vnos;
          if(event.getSource() == btn_vnos){
               input = field.getText();
               s = new StringBuffer(input);
                smth = s;
            }             Thanks

You have needs to use a static variable or somehow pass an instance reference, through a list or array or some such thing, perhaps through the constructor. Or think up some other jazz, like adding a method "public String getMyStinkin'String" ;~)
~Cheers

Similar Messages

  • How to get string value from xml in JSF??

    In JSF How to get string value from xml, .ini and properties file. I want to get string value from xml or text to JSF

    Just use the appropriate API's for that. There are enough API's out which can read/parse/write XML, ini and properties files. E.g. JAXP or DOM4J for xml files, INI4J for ini files and Sun's own java.util.Properties for propertiesfiles.
    JSF supports properties files as message bundle and resource bundle so that you can use them for error messages and/or localization.

  • How to Get In & Out of Match, Get your Downloads and Run

    How to Get In & Out of Match, Get your Downloads and Run 
    So you have read the marketing hype, and are thinking what you really want is to pay for the service to upgrade your low quality bitrate files to a bit better 256KBPS rate easily, as don’t fancy rebuying/ reimporting or other method
    This guide should show you the fastest route to achieve you upgrades
    It assumes you’re working from your main music library, and know something about IT, and have <25k of music files
    Backup your music files
    If you know how to do this, its simple right – so once done then move to step 2, if not read below so you don’t blame me for a loss
    Transfer Hardware
    your choice the transfer hardware, suggest offline harddrive via USB3.0 (blue USB connector/eSata/ 1494b/1GB NIC/etcetera but your call
    If you use USB2.0/ 100MB NIC/1394a or other lower transfer method, accept the time hit
    Don’t use Time Backup/local disk backup software unless you have RAID 5 setup or better (and if wondering what that is, you almost certainly don’t then)
    Don’t use  internet backup service unless you live next door to the hosting company, with stunning internet connection to envy 99.9% of the human race, remember this is the fast method folks)
    Transfer Software
    I am assuming you know how to do a copy n paste/ robocoby/xcopy/drag n drop or whatever method turns you on via finder/explorer/cmd window ect
    Caveat #01: If not sure how to do above, then stop now as you are not IT literate ready for this
    Find your music files and back them up
    Now keep the computer running, preferably with nothing else running from this point for ease of use bar an active internet connection, and power saving switched off
    If you know where the files are great, backup the files, but some don’t so for them as below
    Caveat #02: if you don’t know how to find them your most likely on default settings, or sitting with a legacy from a past upgraded machine - below should help but you might want to stop now if you have never been curious about the location before
    Within iTunes , go to [Edit/Preferences/Advanced] and note down the location shown for Itunes Media Location
    In the same location of preferences, hit [Keep iTunes Media Folder organised] and let the application do its stuff.  You will end up with the location in 1ciii a ready to copy location which for simplicity of topic, copy the whole folder and its subfolders.  You may end up with some extra copies of music files (an iTunes safety mechanism, but it won’t show in the folder location, and we can ignore later on)
    Enable Match (after paying for the service)
    Run Match
    Accept that the Apple iTunes process is not perfect, may crash/stop/pause and reboots will be needed, and we can move on so to speak. Key here is you cannot do an unattended script or assume no end user interaction needed L
    Turn on iTunes Match, notice the new ITunes Match on the left hand sidebar, click it, then hit the Start button – if it works and you eventually get to STEP 3 perfect.
    If it fails before getting to STEP 3, reboot and restart
    If this still fails to get to STEP 3, then create a new iTunes database (browse forums on how to do), read your media files from the location in 1civ
    Stop MATCH  (the upload process only, not the service)
    Once STEP 3 starts, CLICK STOP - ASAP, as all this does it upload data, and you don’t want to do this, just get your upgraded files (remember the title of this entry your reading!)
    This also avoids future issues with Album art lost
    Delete Matched low bitrate files
    Create a NEW SMART playlist, with two criteria
    Show all files with bitrate is less then 256
    Show all files where iCloud status is MATCHED
    In the new playlist, click it and it shows the files we want to blow away. 
    Click Edit / Select All then
    Click ctrl in windows/apple  (cmd) logo in mac, and press delete button, ensuring you do NOT tick the delete from iCloud Option.  Now want a few mins for it do do its stuff.
    Download Upgraded BitRate Files
    In the same location as 5, reselect all, and right click, and select the option to download all, and off it goes
    On the lefthand sidebar in iTunes, click Downloads, and you will then see in the middle bottom screen an option for simultaneous downloads (select it)
    Your done Just let the app now do its stuff. I would ignore the message saying you can get on with other things, and use anther machine, preferably not using the same internet connection.
    Optional Steps:
    Click randomly from the Itunes/Matched/256KBPS listed files, and play them.  Not all the files, one every 30 or so, and just the start, then last few seconds to check not dead or corrupt files.
    Update your Step 1 backup with the new files, which is going to take up more space, guess at 40%.
    Kill your iTunes Match account (both the recurring automatic subscription, and  the account if not continuing to use the store part of iTunes)

    bump

  • How to get string from jtextpane along with its attributes

    sir,
    How to get string from jtextpane along with its attributes
    i,e font,size,style,color etc.
    please help me out.
    my mail id is [email protected]

    JTextPane extends JTextComponent
    JTextComponent.getDocument()
    a Document is a set of Element, see Document.getRootElements(). Each Element has attributes, stored within an AttributSet object see Element.getAttributes()
    a Document can also be rendered as a String, see Document.getText( offest, length ), use it with 0 and Document.getLength() as parameters.

  • How to get data out of XML?

    Hi,All.
    I am running SAX (JAXP1.01) in Applet to process XML file. My question is how to get data out of xml format according to the field name (@age,@rank etc)
    and write into string buffer seperated by comma.
    Should I use SAX or DOM? (file size is big)
    My xml as follow :
    <ROOT>
    <FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@team/relay}">
         <ObjectName>Field124</ObjectName>
         <FormattedValue>HUNTER</FormattedValue>
         <Value>HUNTER</Value>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@age}">
         <ObjectName>Field125</ObjectName>
         <FormattedValue> 19</FormattedValue>
         <Value> 19</Value>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@Rank}">
         <ObjectName>Field126</ObjectName>
         <FormattedValue>43</FormattedValue>
         <Value>43</Value>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{results.athrel_name}">
         <ObjectName>Field127</ObjectName>
         <FormattedValue>1-1 NORRIE</FormattedValue>
         <Value>1-1 NORRIE</Value>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@timefield2}">
         <ObjectName>Field128</ObjectName>
         <FormattedValue>1:54.75</FormattedValue>
         <Value>1:54.75</Value>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@timefield1course}">
         <ObjectName>Field129</ObjectName>
         <FormattedValue/>
         <Value/>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@timefield1std}">
         <ObjectName>Field130</ObjectName>
         <FormattedValue/>
         <Value/>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@timefield2course}">
         <ObjectName>Field131</ObjectName>
         <FormattedValue/>
         <Value/>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@timefield2std}">
         <ObjectName>Field132</ObjectName>
         <FormattedValue>QT</FormattedValue>
         <Value>QT</Value>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@points(left)}">
         <ObjectName>Field133</ObjectName>
         <FormattedValue/>
         <Value/>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@pointsdecimal}">
         <ObjectName>Field134</ObjectName>
         <FormattedValue/>
         <Value/>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:decimal" FieldName="{@points(right)}">
         <ObjectName>Field135</ObjectName>
         <FormattedValue>0</FormattedValue>
         <Value>0.00</Value>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@timefield1}">
         <ObjectName>Field136</ObjectName>
         <FormattedValue>1:55.98</FormattedValue>
         <Value>1:55.98</Value>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@Rank}">
         <ObjectName>Field137</ObjectName>
         <FormattedValue>43</FormattedValue>
         <Value>43</Value>
    </FormattedReportObject>
    Repeat...
    </FormattedReportObject>
    </ROOT>
    ------------------------------------------------

    For big files use SAX: quicker and less memory usage.
    The xerces parser from Apache has some examples. Basically what you do is scan the XML, remembering what tag you are and once you find the right tag, read the contents.

  • My 4gb SDHC flash mem card is stuck in DVD slot on my iMac 27". How to get it out?

    I misplaced my 4GB flash memory card (Canon camera) in the DVD slot (above the card slot) and it disappeared while I was trying to get it out. Naturally I inadvertently (spelled "stupidly") knocked it inside and could not figure out how to get it out. The dust rubber "shields" hide it and I've tried to find it with a toothpick and wedge it out, to no avail. Are there any ideas or suggestions others may have used to get it out (I know turning it on it side and shaking won't work). Why in the world did they design it like it is -- I've had it happen to me and others have also told me of their misadventures, but they also were able to gradually get it out. This time, it's in too deep. Can I ignore it and still use the CD/DVD slot without it blowing up?

    You might need to take to an Apple technician or apple dealer to let them take apart the iMac and remove the flash memory card. if you're very careful you might try a pair of needle nose pliers and a flashlight but it's easy to do damage to the DVD internal mechanical if you're not real careful.
    A good story to tell your grand kids maybe ;-)
    Good luck

  • How to get graininess out of black areas?

    How to get grainiesss out of black or dark areas?

    you can't.
    a) too low light recording results in 'noise' due to in-camera amplification
    b) noise is handled by the compressors as 'content'; which results in blocky artefacts.
    for FCPX are plugins avail, as the famous Natress DeNoiser, which smoothen such pictures (very well). a $$$ solution.-
    next time more light …

  • How to get string (specified by line and column) from txt file with labview

    Hi everyone
    How to get string (specified by line and column) from txt file with labview
    thx 
    Solved!
    Go to Solution.

    As far as I know, a text file has no columns.  Please be more specific.  Do you mean something like the 5th word on line 4, where words are separated by a space, and lines are separated by a newline character?  You could the Read from Spreadsheet String function and set the delimiter to a space.  This will produce a 2D array of strings.  Then use index array and give the line number and column number.
    - tbob
    Inventor of the WORM Global

  • The headphone connector broke off inside my Ipod, any suggestions on how to get it out?

    The headphone connector broke off inside my Ipod, any suggestions on how to get it out?

    See this previous discussion:
    Broken headphone jack! 3.5mm dillemma....: Apple Support Communities

  • How to get the result of a method on a page

    I use JDeveloper 11g
    I want the result of a method (String) in the ApplicationModule on a page (jspx)
    What I have done is:
    1. make a method (getValue) in the ApplicationModule Algemeen (also in Client interface)
    2. make a pagedef-file with executables and bindings, see
    <executables>
    <invokeAction id="doGetValue" Binds="getValue"
    Refresh="renderModel"/>
    <variableIterator id="variables" Refresh="renderModel">
    <variable Type="java.lang.String" Name="getValueReturn"
    IsQueriable="false" IsUpdateable="0"
    DefaultValue="${bindings.getValue.result}"/>
    </variableIterator>
    </executables>
    <bindings>
    <methodAction id="getValue" RequiresUpdateModel="true"
    Action="invokeMethod" MethodName="getValue"
    IsViewObjectMethod="false" DataControl="AlgemeenDataControl"
    InstanceName="AlgemeenDataControl.dataProvider"
    ReturnName="AlgemeenDataControl.methodResults.getValue_AlgemeenDataControl_dataProvider_getValue_result"/>
    <attributeValues IterBinding="variables" id="ValueReturn">
    <AttrNames>
    <Item Value="getValueReturn"/>
    </AttrNames>
    </attributeValues>
    </bindings>
    3. on the page (jspx) I have an outputText-component:
    <h:outputText value="#{bindings.ValueReturn.inputValue}"/>
    But, it does not work, I don't get the result of the method on the screen.
    Who can help me with this?

    Hi,
    Simple example below:
    Suppose you have this method in AppmoduleImpl:
    public void testHello( ) {
    return "Hello";
    1.After you expose this to clientInterface,drop this method on the jspx page as ADF Parameter
    form
    2.Drop the return String as outputText
    3.Run the page,click on the commandButton & the outputText returns 'Hello'
    Regards,
    Shantala

  • How to get data out of Vector of vector ???

    All,
    I have a vector v1 which is getting populated by the resultset of the database. This vector has another two vectors vrow & vcol .
    Code as follows ---
    v1 = new Vector();
    while(rs1.next()) {
         Vector vrow = new Vector();
         for (int i=intstartday ; i <= intendday ; i++)
         {     // here I am getting the new result set for each i //
              ResultSet rs2 = getResultSet();
              while(rs2.next()) {
                   Vector vcol = new Vector();
                   vcol.addElement(rs2.getString("day"));
                   vcol.addElement(rs2.getString("reg_hr"));
                   vcol.addElement(rs2.getString("dateday"));
                   vrow.addElement(vcol);
              rs2.close();                              
         } // for loop end
         vrow.addElement(strChargeNmbr);
         v1.addElement(vrow);                    
    } // end of rs1 resultset while loop
    I need to get the data out of this vector v1. If anyone has any insight on this - how to get the data from vectors which has differnt type of objects in it , please send me the code example asap.
    thanx

    Thanks for your suggestion. It is working now except that I am having problems in getting the charge NUmber out....Charge NUmber is nothing but a String.
    So my row Vector has two values
    1. Check the code where I am populating the Vectors
    while(rs1.next()) {
    strsubmittime = rs1.getString("SUBMIT_TS");
    strapprovetime = rs1.getString("APP_DIS_TS");
    strapprempid = rs1.getString("APP_DIS_EMP_ID");
    strChargeNmbr = rs1.getString("entered_cn");               
    Vector vLaborrow = new Vector();
    for (int i=intstartday ; i <= intendday ; i++)
    // here execute the query and get the result set for every i //                         ResultSet rs2 = getResultSet();
         while(rs2.next()) {
         Vector vLaborcol = new Vector();
         vLaborcol.addElement(rs2.getString("day"));
         vLaborcol.addElement(rs2.getString("reg_hr"));
         vLaborcol.addElement(rs2.getString("dateday"));
         vLaborrow.addElement(vLaborcol);
    } // for loop end
    vLaborrow.addElement(strChargeNmbr);
    vLabor.addElement(vLaborrow);
    } // end of rs1 resultset while loop
    2. check out the following code where I am trying to get the Charge NUmber values out.--
    for(int i=0;i<vLabor.size() ;i++)
    Vector rowVec = (Vector)vLabor.elementAt(i);
    for(int j=0; j< rowVec.size() -1 ; j++)
    try
         if (j==0) {
    String strChargeNmbr = (String)rowVec.elementAt(j) ;
    Vector laborcol = (Vector)rowVec.elementAt(j);
    String day = (String)laborcol.elementAt(0);
    String reg_hr = (String)laborcol.elementAt(1);
    String dateday = (String)laborcol.elementAt(2);
    strChargeNmbr = strChargeNmbr + " " + reg_hr ;
    }catch(ClassCastException e){
         System.out.println("Reading in vector2");
    } // end of j for loop
    System.out.println(strChargeNmbr);
    } // end of i for loop
    I am getting the following Exception --
    "Reading in vector2"
    Please send me the code -- how to get the Charge NUmber out. I am confused where to get the value - is it in the first for loop or second for loop ??

  • How to get String form java JTable row?

    Hello everybody,
    Can anybody tell me how to get value as String form java JTable row?

    I found solution:
            table.addMouseListener(new MouseAdapter() {
                @Override
                public void mouseClicked(MouseEvent evt) {
                    if (evt.getClickCount() == 2){
                        int col = table.getSelectedColumn();
                        int row = table.getSelectedRow();
                        String tableUrl = ((String)table.getModel().getValueAt(row, col));
                        ur.openUrl(tableUrl);
            });

  • How to get string in reverse order?

    Hi I have line as follows...
    String line = "officer.Bangalore, ind",corp\user,passwordAdapter;I want to get the out put of string in reverse order....
    passwordAdapter,corp\user, "officer.Bangalore, ind" please help on code to get this output....
    I tried with using StringBuffer class but it reversing the content of string but not order of string..
    thank in advance....
    Jags

    srry for that...
    lets assume the above is line from file and storing in a string variable..
    In that case.. how can i reverse the order of string(line)...
    i know it should be like this..
    String line = "\"officer.Bangalore, ind\",corp\user,passwordAdapter";plz do the needfull...
    thanks,
    jags

  • Huge Problem: How to get Information out of the SAP System into MySQL?

    Hi all
    Im totally despaired... So im comming here, hoping to find ANY solution.
    I wrote a Program, which creates a internal Table wich some information from many DDIC-Tables. The internal Table is about 7 Columns, with only char fields.
    Also I have a MySQL Server (reached through the Internet), with a database on it, and a table, which looks 1:1 as my internal Table in ABAP does.
    Now I want to append the Data from the internal Table to the MySQL Table.
    Is there ANY chance of getting this done?
    and btw. can I append this Data with a secured connection?
    THX for help...
    greets
    Markus Voelker

    Think of Orchestrator as a "router", that will route information and workflows between SCOM, and [insert 3rd party product here].  Depending on your 3rd party product, there may be an "integration pack" for it that Orchestrator can use for out of the
    box tasks.
    So what's an integration pack?  Well - think of it like a management pack, but for Orchestrator.  SCOM does monitoring, but it doesn't know how to monitor something unless you install the relevant management pack.  The management pack contains
    all the rules/monitors for monitoring whatever it is you wish to monitor.
    Well, an integration pack is similar in concept, except it tells Orchestrator how to interface and integrate with whatever it is you're trying to perform tasks with. 
    For what you want to do, there is a SCOM integration pack.  This is a set of tasks that can get alerts and events out of Operations Manager (there are also tasks that can create and close alerts in Operations Manager). 
    From what I can imagine - you would want to get alerts out of SCOM when they happen (so you would use one of the SCOM orchestrator tasks to "get alert if status = new, and source = myapplication"), and then you can pass that alert to another task - such
    as write it to a CSV file or something.  You could then have another task that picks up that CSV file, and passes it to your application where it can be captured.  Or you could use the CSV to populate variables in a powershell script, and then powershell
    that information into your app.
    There are many ways you could do this, but I do believe that Orchestrator would be the better option. 
    http://www.dreamension.net

  • How to get the OUT value of a PL/SQL procedure?

    that is to say, I want to get a number form a procedure which code is familiar to:
    create or replace procedure get_salary(
    name in varchar2,
    id in varchar2,
    salary out number
    In java code, How to get the value of salary?
    PLZ

    You'll want something like this:
    CallableStatement stmt;
    Connection        conn;
    << Create connection to database >>
    stmt = conn.prepareCall( "{call get_salary( ?, ?, ? )}" );
    stmt.setString( 1, someName );
    stmt.setString( 2, someID   );
    stmt.registerOutParameter( 3, java.sql.Types.INTEGER );
    stmt.executeUpdate();
    int outSalary = stmt.getInt( 3 );Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

Maybe you are looking for

  • Not able to delete file from external hard disk

    I connected my external hard disk to my macbook pro. But am not able to delete any file since it says the file cannot be deleted when I move it to trash. Could you let me know how to delete a file from the external hard disk?

  • Changing from Windows to OSX, can I use the same serial number, how to do it?

    I purchased elements 10 from Adobe online and installed on a windows machine, I now have an IMac, can I install use my serial number on my new machine? I have downloaded elements 10 from my account however, it is a windows file? Is there away around

  • PDK pl/sql add_item function and documents table

    When we use the add_item function to add an item and upload its content, does the add_item function uploads document content to the document table in the repository?(like the upload_blob() function) If yes, can I remove the uploaded document from the

  • How to perform a Oracle-Offline-Backup started from within SAP in Cluster

    Hello, I didn't find a solution on web (at SAP/SUN/newsgroups) for the following problem: environment - offline-backup of Oracle-database (database of an SAP-R/3 ERP-system) - Sun Cluster 3.1 environment (SUNW.oracle_server:3.1, SUNW.oracle_listener:

  • Using 2 different databases in Oracle 9i with HTML DB

    I'm new to appex and I am wondering if I can use it to use data from different databases within Oracle 9i, and if so, how/where can I find out to do it. Basically I have an already existing database in 9i, and I have to create another one that uses i