Clearing text area?

Hey all Im trying to do something that sounds easy yet I am unable to do it. I can add a filename to a JtextArea using file chooser . However if i add a new file i want it to wipe out the existing filename so that it only displays the original one. i tried using a built in clear or isempty method with a while loop but i get errors. if anyone knows the answer could they please tell me, cheers in advance.

[code[
yourTextArea.setText(""); //is that all you're trying to do?

Similar Messages

  • I want to know how to clear the text area by the push off my next question button and ask a new ques

    I want to know how to clear the text area by the push off my next question button and ask a new question - also I want to know how to code in my project to where a user can enter a math question in one border container and the answer enters into the next container
    heres my code so far
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" backgroundColor="#1E5C75">
        <fx:Script>
            <![CDATA[
                protected function button1_clickHandler(event:MouseEvent):void
                    //convert text area into labelid to be identified by actionscript
                    richTextLabel.text = myArea.text;
            ]]>
        </fx:Script>
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <!--container 1-->
        <s:BorderContainer borderWeight="7" x="28" y="10" width="200" height="138">
            <s:layout>
                <s:VerticalLayout paddingTop="10" paddingBottom="10"
                                  paddingLeft="10" paddingRight="10"/>
            </s:layout>
            <!--data Entry control-->
            <s:TextArea id="myArea" width="153" height="68"/>
            <!--end of data entry control-->
            <s:Button width="151" label="ask a question" click="button1_clickHandler(event)"/>
        </s:BorderContainer>
        <!--container2-->
        <s:BorderContainer borderWeight="7" x="509" y="10" width="200" height="138">
            <s:layout>
                <s:VerticalLayout paddingTop="10" paddingBottom="10"
                                  paddingLeft="10" paddingRight="10"/>
            </s:layout>
    <!--data entry control-->
            <!--convert tne data entry control into a label id in actionscript-->
            <s:Label id="richTextLabel" width="153" height="68"/>
            <s:Button width="151" label="next question" click="button1_clickHandler(event)"/>
        </s:BorderContainer>
        </s:Application>

    This is a user to user support forum.  We are all iphone users just like you.
    You are not addressing Apple here at all.
    This is an odd way to ask your fellow iphone users for help. Berating oterh users will not help you.
    "it's too fragile"
    No it is not.  i have never damaged one, nor has anyone I know.
    " U loose data when Ur phone is locked"
    No you don't.  Why do you think this?
    "and there is no customer support!!!  "
    Wrong yet again.  Apple has an 800 number and they have many retail stores and they have support articles that you can access using the search bar. Or you can contact them throgh express lane online
    "but I will go back with Blackberry "
    Please do.
    Good ridance

  • CUCM Security - Are Jitter, Latency and Packet Loss Stats in Clear Text ?

    I've reviewed the Cisco Unified Communications Manager Security Guide and see no suggestion that implementing encryption prevents MoS scoring.  In other words, when you implement encryption, do you still have access to jitter, latency and packet loss information in clear text?
    TIA,
    Amir

    Well.. the phones measure the statistics.
    The phones then report the stats to CUCM for inclusion in the CMRs.
    ... as I recall this is done via SCCP.
    So yes, it's clear text, unless your signalling is encrypted generally. On most clusters it's not.
    Aaron

  • Text wrap for a paragraph: How to define the width of a Text box /  active text area? I simply need a longish text to wrap within the frame!

    Hello, I've been searching for a good while in the forums now, but have found no solution or real mention of the problem – I hope some of you can help.
    I want to very simply layout a text between scenes, a slightly longer text that wraps within the frame margins. Here's an example of how I want it to look:
    Now, I couldn't for the life of me get the Custom Text to behave like that, as there are no parameters to set for the width of the text area. The Text Size, yes, along with the Tracking, Baseline and all that, but the width of the text box, no. The above was created by customizing one of the other Text Generator presets that happened to be left aligned.
    However, this preset has a fade in/fade out transition, which I do not want. There's no way to remove this transition as it seems integrated into the Text Generator (meaning they are not really presets, but separate kinds of Text objects? Very silly.)
    So I am asking you: Is there any way to get the Custom Text generator to behave like that? Just a text paragraph as above. Below you'll see all I can manage with the diffferent Custom Text parameters. Any kind of repositioning and resizing of the text just changes the position and size of the frame – but the actual text items are just cropped off where they extend out of that frame. Apparently the bounding box for the text is just some default length, and I can't find any way to adjust the width. See below my different attempts.
    The same text pasted into a Custom Text generator clearly extends outside the frame:
    Here Transform just moves – or resizes – the video frame that the Text Box exists inside:
    The Crop gives similar results, and of course Distort doesn't get me closer to what I need, either. There should be simply a Text Box Width parameter to set somewhere, but if it exists they have hidden it very well. How do you do it?
    Thanks for any help, this is a silly problem, but one of now many trivial problems that amount to me growing quite dissatisfied with FCPX. Hopefully I've just overlooked something.
    All the best,
    Thomas

    Thomas...same kind of crap here.
    I used Custom Text - entered a sentence, hit return, entered another.
    Set to 72 pt.
    The default alignment is centred - I want left aligned text...the text start point stays at the centre of frame and the sentence runs off the edge of the bounding box.
    There is no settings in the Text or Title inspector dialog to correct that!
    Using Transform will not sort it!

  • ACS 5.3 Showing Clear Text Password in Authorization reports

    Hello,
    When a tacacs user is changing the local password on the router (for local user), the acs 5.3 is showing the new password in clear text in authorization reports/logs.
    This behaviour is seen on acs 5.x, whereas acs 4.2 is showing encrypted password in the reports.
    I have checked debugs on Router and it is sending password in clear text in Tacacs Authorization packet but encrypted password in Tacacs Accounting logs.
    Debug tacacs accounting
    debug aaa accounting
    4w3d: TPLUS: Received accounting response with status PASS
    4w3d: TPLUS: Queuing AAA Accounting request 208 for processing
    4w3d: TPLUS: processing accounting request id 208
    4w3d: TPLUS: Sending AV task_id=459
    4w3d: TPLUS: Sending AV timezone=UTC
    4w3d: TPLUS: Sending AV service=shell
    4w3d: TPLUS: Sending AV priv-lvl=15
    4w3d: TPLUS: Sending AV cmd=username sansehga privilege 15 password *****
    4w3d: TPLUS: Accounting request created for 208(sanjay)
    debug tacas authorization
    debug aaa authorization
    4w3d: AAA/MEMORY: create_user (0x851611DC) user='sanjay' ruser='R1' ds0=0
    port='tty7' rem_addr='10.76.212.159' authen_type=ASCII service=NONE priv=15
    initial_task_id='0', vrf= (id=0)
    4w3d: tty7 AAA/AUTHOR/CMD(1390711548): Port='tty7' list='' service=CMD
    4w3d: AAA/AUTHOR/CMD: tty7(1390711548) user='sanjay'
    4w3d: tty7 AAA/AUTHOR/CMD(1390711548): send AV service=shell
    4w3d: tty7 AAA/AUTHOR/CMD(1390711548): send AV cmd=username
    4w3d: tty7 AAA/AUTHOR/CMD(1390711548): send AV cmd-arg=sansehga
    4w3d: tty7 AAA/AUTHOR/CMD(1390711548): send AV cmd-arg=privilege
    4w3d: tty7 AAA/AUTHOR/CMD(1390711548): send AV cmd-arg=15
    4w3d: tty7 AAA/AUTHOR/CMD(1390711548): send AV cmd-arg=password
    4w3d: tty7 AAA/AUTHOR/CMD(1390711548): send AV cmd-arg=sehgal
    4w3d: tty7 AAA/AUTHOR/CMD(1390711548): send AV cmd-arg=<cr>
    4w3d: tty7 AAA/AUTHOR/CMD(1390711548): found list "default"
    4w3d: tty7 AAA/AUTHOR/CMD(1390711548): Method=tacacs+ (tacacs+)
    4w3d: AAA/AUTHOR/TAC+: (1390711548): user=sanjay
    4w3d: AAA/AUTHOR/TAC+: (1390711548): send AV service=shell
    4w3d: AAA/AUTHOR/TAC+: (1390711548): send AV cmd=username
    4w3d: AAA/AUTHOR/TAC+: (1390711548): send AV cmd-arg=sansehga
    4w3d: AAA/AUTHOR/TAC+: (1390711548): send AV cmd-arg=privilege
    4w3d: AAA/AUTHOR/TAC+: (1390711548): send AV cmd-arg=15
    4w3d: AAA/AUTHOR/TAC+: (1390711548): send AV cmd-arg=password
    4w3d: AAA/AUTHOR/TAC+: (1390711548): send AV cmd-arg=sehgal
    4w3d: AAA/AUTHOR/TAC+: (1390711548): send AV cmd-arg=<cr>
    4w3d: AAA/AUTHOR (1390711548): Post authorization status = PASS_ADD
    Please share if someone has found the fix to this problem.
    Regards,
    Akhtar

    Thanks Tarik,
    But it seems it did not help overall
    Akhtar: Cisco needs long time to fix bugs unless it is P1 or P2 bug. Otherwise they'll do it at their leisure.
    If you are not on latest patch already then upgrade. If you are already on the latest patch then wait for the next one. If your bug is not mentioned to be fixed on the resolved caveats don't panic. I've seen many bugs fixed but not mentioned in the release notes. What you need to do is to contact TAC so they contact the BU for your behalf to confirm if the bug is resolved or not.
    Regards,
    Amjad

  • Allowing clear-text logins for multiple users

    I'm not sure if this is the correct section to place this question in, so Mods, please move if needed.
    As many know, Apple changed the AFP Client defaults in 10.5.x so that clear-text logins to servers are disallowed by default. You can edit the afpcleartextallow option in ~/Library/Preferences/com.apple.AppleShareClient.plist to enable it on a per user basis.
    What I wish to know is wether it's possible to allow clear-text logins on a global basis. I've looked at /Library/Preferences/com.apple.AppleShareClient.plist and it does not contain the afpcleartextallow option, and adding the option and setting it to "yes" (without editing the file in the user's preference folder) does not allow clear-text logins.
    Is there some global preference file that this option could be added to that would preclude me from having to edit the preference file for every user? Part of the reason it's a problem is if you have multiple user accounts on multiple machines, or network based home folders stored on an AFP server that only supports clear text, for example, a Netware 6.5 server running NFA for Mac.
    One problem I've seen is that until the user is actually at the desktop (well I think it's specifically when the Finder loads and reads the per-user preferences) the OS will prevent clear-text logins, regardless of the setting in the pref file, thus you cannot automatically mount volumes at login if the server only supports clear-text.
    Any suggestions or advice greatly welcomed.

    If you are familiar with the exchange man shell, use the new-mailboxsearch powershell cmdlet in your code.  You can pass it a list of -SourceMailboxes(use get-content to pass your .txt to a variable, you'll want to place each name on a new line) to
    search on/set the in place hold.. Here is the technet material on new-mailboxsearch. 
    http://technet.microsoft.com/en-us/library/dd298064(v=exchg.150).aspx

  • Can a script manually insert a delete (or backspace) into a text area?

    I'm new to action script, so this may have a simple answer, sorry if that's the case.
    I have a little movie created with a simple purpose of trying to mimic a system like cell phones have for character input.
    There are two text areas, one hidden off the screen that accepts the input from the user; a second text area in on screen and displays what the user had entered after some basic processing on the input.
    The hidden text area is pretty basic with listener that is responsible for grabbing the input keys and then mangling them to be inserted into the displayed text area based on the cell phone text entry multi-tap rules. Example user press 2-2-2  and the hidden input accepts 222 and then appends 'C' to the display text area. That's working great, but I have a problem if the user wants to delete from the display text area. I can't find a way to insert a delete or backspace key into the display text area. I've tried using StringFromCharCode (8) // Key.BACKSPACE, but that doesn't work. That just displays one of those undefined glyphs. I figure that things like clear, and delete are handled somewhere higher in the input chain and that's where I'm having a problem.
    I've looked, but I can't find a way to delete a single character from the text area. I was thinking if I could find the cursor location that I could just use some delete character method to get the job done, but I couldn't find how to do that.
    Any ideas on how to pull off manual delete function in a text area?

    Ned, I do really want to manually (by method of code) trigger a delete in a text area. The delete (or backspace) that I want added to the text area isn't directly entered by the user, it's the result of several key presses by the user. That's why I called it "manual" because it's done by the code, not by the user's direct input.
    Think about how text entry works on most phones... if you want to enter a letter you have to cycle through all the letters on a single key until you get to the character desired. As I stated before, if you want a 'c' you need to press 2 button 3 times. This is basically what I'm trying to do, but I want to add the ability to delete a character too if the correct sequence in entered, for example a sequence of ### would equal a backspace.
    Rothrock, I think you were thinking the same thing that a single key is used to do a backspace.
    I was thinking that I could possibly insert key event into the event queue for the text area to process, but I wasn't sure about that.
    Sorry, if this is confusing, I know it's not a straight forward design. I need onscreen and offscreen text areas with the onscreen one acting as a slave of the offscreen one.
    The way the code currently works is hidden text area had a listner that responds to changes, and that handler processes the key entered and deletes that character from the hidden text area. After the full sequence of characters (say 2 button has been pressed 3 times) the handler then sends the resulting character into the display text area. This part of the code works great. I can add any character including some specials like tab and newline. However if I want the text area to delete a character I don't have a way to do that. That's why I tried to insert the backspace key (0x08 or ^H, for other oldschoolers), but using that as a char code or string from char code doesn't work.
    I had also tried to create to set the focus to the display text area then create and dispatch a backspace keydown and keyup events to the visible text area and then return the focus back to the hidden textarea, but... no luck.

  • HT5364 I installed OX X Moutain Lion and now I have trouble printing pdf documents--get messages like "plug in failed" or "no pages selected on printer" when clearly pages are selected

    I installed OS X Mountain Lion on my desktop MAC and since then I cannot print pdf documents---I get messages like "plug in failed" or sometimes "no pages selected on printer" when clearly pages are selected

    DO NOT USE PREVIEW TO FILL OUT PDF FORMS, IT WILL DESTROY PDF FILES. Sorry, but I had to shout here to prevent damage to your PDF files.
    Here is one of the symptoms when you fill out a PDF form with Preview: If you save it and return it to the author, they will not be able to see the text that you've added to form fields - unless they click on a field, which will reveal the contents of just that field. You can recover from this problem, but Preview will also remove other field types, and will actually rewrite your complete PDF while ignoring what it does not understand. Take a look at this blog post for more information about the damage that Preview will cause: Preview.app - Killer of PDF Files

  • Why Can't I get my total to output to the text area?

    I can get the numbers to go to the text area and to clear the text area but, the only way I have figured out how to output the total is with a JOptionPane. Can someone look at my code and tell me how to fix this?
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Calculator4 extends JApplet implements ActionListener
    String Nums="";
    String sNum="";
    double Num1=0;
    double Num2=0;
    double Add=0;
    double Subtract=0;
    double Multiply=0;
    double Divide=0;
    int choice=0;
    private JTextField displayField;
    private JButton Button0, Button1, Button2, Button3, Button4, Button5,
    Button6, Button7, Button8, Button9, ButtonAdd, ButtonSub,
    ButtonMult, ButtonDiv, ButtonClear, Buttontotal;
    public void init()
    Container container = getContentPane();
    container.setLayout(new FlowLayout());
    displayField = new JTextField(15);
    displayField.setEditable(false);
    container.add(displayField);
    Button1 = new JButton("1");
    Button1.addActionListener(this);
    container.add(Button1);
    Button2 = new JButton("2");
    Button2.addActionListener(this);
    container.add(Button2);
    Button3 = new JButton("3");
    Button3.addActionListener(this);
    container.add(Button3);
    ButtonAdd = new JButton("+");
    ButtonAdd.addActionListener(this);
    container.add(ButtonAdd);
    Button4 = new JButton("4");
    Button4.addActionListener(this);
    container.add(Button4);
    Button5 = new JButton("5");
    Button5.addActionListener(this);
    container.add(Button5);
    Button6 = new JButton("6");
    Button6.addActionListener(this);
    container.add(Button6);
    ButtonSub = new JButton("-");
    ButtonSub.addActionListener(this);
    container.add(ButtonSub);
    Button7 = new JButton("7");
    Button7.addActionListener(this);
    container.add(Button7);
    Button8 = new JButton("8");
    Button8.addActionListener(this);
    container.add(Button8);
    Button9 = new JButton("9");
    Button9.addActionListener(this);
    container.add(Button9);
    ButtonMult = new JButton("*");
    ButtonMult.addActionListener(this);
    container.add(ButtonMult);
    Button0 = new JButton("0");
    Button0.addActionListener(this);
    container.add(Button0);
    ButtonDiv = new JButton("/");
    ButtonDiv.addActionListener(this);
    container.add(ButtonDiv);
    ButtonClear = new JButton(" Clear ");
    ButtonClear.addActionListener(this);
    container.add(ButtonClear);
    Buttontotal = new JButton("=");
    Buttontotal.addActionListener(this);
    container.add(Buttontotal);
    public void actionPerformed(ActionEvent actionEvent)
    if(actionEvent.getSource() == Button1)
    play(getCodeBase(),"Ping.WAV");
    if(Nums==null)
    {  Nums= "";
    displayField.setText("1");}
    if(Nums!=null)
    {  Nums= Nums + 1;
    updateDisplay();}
    else if(actionEvent.getSource()==Button2)
    play(getCodeBase(),"Ping.WAV");
    if(Nums==null)
    {  Nums= "";
    displayField.setText("2");}
    if(Nums!=null)
    {  Nums= Nums + 2;
    updateDisplay();}
    else if(actionEvent.getSource()==Button3)
    play(getCodeBase(),"Ping.WAV");
    if(Nums==null)
    {  Nums= "";
    displayField.setText("3");}
    if(Nums!=null)
    {  Nums= Nums + 3;
    updateDisplay();}
    else if(actionEvent.getSource()==Button4)
    play(getCodeBase(),"Ping.WAV");
    if(Nums==null)
    {  Nums= "";
    displayField.setText("4");}
    if(Nums!=null)
    {  Nums= Nums + 4;
    updateDisplay();}
    else if(actionEvent.getSource()==Button5)
    play(getCodeBase(),"Ping.WAV");
    if(Nums==null)
    {  Nums= "";
    displayField.setText("5");}
    if(Nums!=null)
    {  Nums= Nums + 5;
    updateDisplay();}
    else if(actionEvent.getSource()==Button6)
    play(getCodeBase(),"Ping.WAV");
    if(Nums==null)
    {  Nums= "";
    displayField.setText("6");}
    if(Nums!=null)
    {  Nums= Nums + 6;
    updateDisplay();}
    else if(actionEvent.getSource()==Button7)
    play(getCodeBase(),"Ping.WAV");
    if(Nums==null)
    {  Nums= "";
    displayField.setText("7");}
    if(Nums!=null)
    {  Nums= Nums + 7;
    updateDisplay();}
    else if(actionEvent.getSource()==Button8)
    play(getCodeBase(),"Ping.WAV");
    if(Nums==null)
    {  Nums= "";
    displayField.setText("8");}
    if(Nums!=null)
    {  Nums= Nums + 8;
    updateDisplay();}
    else if(actionEvent.getSource()==Button9)
    play(getCodeBase(),"Ping.WAV");
    if(Nums==null)
    {  Nums= "";
    displayField.setText("9");}
    if(Nums!=null)
    {  Nums= Nums +9;
    updateDisplay();}
    else if(actionEvent.getSource()==Button0)
    play(getCodeBase(),"Ping.WAV");
    if(Nums==null)
    {  Nums= "";
    displayField.setText("0");}
    if(Nums!=null)
    {  Nums= Nums + 0;
    updateDisplay();}
    else if(actionEvent.getSource()==ButtonAdd)
    play(getCodeBase(),"Ping.WAV");
    choice = 1;
    sNum="";
    sNum = Nums;
    Nums=null;
    else if(actionEvent.getSource()==ButtonSub)
    play(getCodeBase(),"Ping.WAV");
    choice = 2;
    sNum="";
    sNum = Nums;
    Nums=null;
    else if(actionEvent.getSource()==ButtonMult)
    play(getCodeBase(),"Ping.WAV");
    choice = 3;
    sNum="";
    sNum = Nums;
    Nums=null;
    else if(actionEvent.getSource()==ButtonDiv)
    play(getCodeBase(),"Ping.WAV");
    choice = 4;
    sNum="";
    sNum = Nums;
    Nums=null;
    else if(actionEvent.getSource()==Buttontotal)
    play(getCodeBase(),"Ping.WAV");
    if(choice==0)
    JOptionPane.showMessageDialog(null,"Please Select Operation");
    if(choice!=0)
    switch(choice)
    case 1:
    if(Nums!=null)
    {    Num1 = Double.parseDouble(sNum);
    Num2 = Double.parseDouble(Nums);
    double Add = Addition(Num1, Num2);
    JOptionPane.showMessageDialog(null,"Your Sum is: " + Add);
    sNum = "";
    if(Nums==null)
    JOptionPane.showMessageDialog(null,"Please Enter Second number");
    Nums=null;
    break;
    case 2:
    if(Nums!=null)
    {    Num1 = Double.parseDouble(sNum);
    Num2= Double.parseDouble(Nums);
    double Subtract = Subtraction(Num1, Num2);
    JOptionPane.showMessageDialog(null,"Your Difference is: " + Subtract);
    sNum = "";
    if(Nums==null)
    JOptionPane.showMessageDialog(null,"Please Enter Second number");
    Nums=null;
    break;
    case 3:
    if(Nums!=null)
    {    Num1= Double.parseDouble(sNum);
    Num2= Double.parseDouble(Nums);
    double Multiply = Multiplication(Num1, Num2);
    JOptionPane.showMessageDialog(null,"Your Product is: " + Multiply);
    sNum = "";
    if(Nums==null)
    JOptionPane.showMessageDialog(null,"Please Enter Second number");
    Nums=null;
    break;
    case 4:
    if(Nums!=null)
    {    Num1 = Double.parseDouble(sNum);
    Num2= Double.parseDouble(Nums);
    double Divide = Division(Num1, Num2);
    JOptionPane.showMessageDialog(null,"Your Quotient is: " + Divide);
    sNum = "";
    if(Nums==null)
    JOptionPane.showMessageDialog(null,"Please Enter Second number");
    Nums=null;
    break;
    else if(actionEvent.getSource()==ButtonClear)
    play(getCodeBase(),"Ping.WAV");
    displayField.setText("");
    Nums=null;
    sNum="";
    choice=0;
    Num1=0;
    Num2=0;
    public void updateDisplay()
    displayField.setText(Nums);
    public double Addition(double Num1, double Num2)
    return ( Num1 + Num2);
    public double Subtraction(double Num1, double Num2)
    return ( Num1 - Num2);
    public double Multiplication(double Num1, double Num2)
    return ( Num1 * Num2);
    public double Division(double Num1, double Num2)
    return ( Num1 / Num2);
    }

    You mean something like this:
    private int currentNumber =0;
    private int total = 0;
    private JTextField Display = new JTextField(10);
    private JtextField Current = new JTextField(10);
    // Add all your buttons correctly
    // Try using a GridLayout to make it easier
    // blah blah
    public void actionPerformed( ActionEvent event )
    int number = -1;
    String Command = event.getActionCommand();
    // Play your sound here.....
      doPlaySound();
    try
       number = Integer.parseInt( command );
    catch( NumberFormatException NFE )
        //ignore
    if( number != -1 )
        doIsNumber( number );
        return;   // don't process further
    if( command == "Enter" )
        doEnter();
        return;
    if(command == "Plus" )
        doPlus();
        return;
    // and so on
    }//end actionPerformed
    private void doNumber( int number )
       String S;
        currentNumber = ( currentNumber * 10 ) + number;
        S = Integer.tostring( currentNumber );  //cant remember if that throws anything
       Current.setText( S );  //Display Work Number
      private void doPlus()
        String S;
        total = total + currentNumber;
        currentNumber = 0;
        Current.setText("");
        S = Integer.toString( total );
        Display.setText( S );
      private void doEnter()
        total = currentNumber;
        currentNumber = 0;
        Current.setText( "");
        Display.setText( Integer.toString( total ) );
      private void doDivide()
         System.out.println("Err you got to be kidding");
      }yeh and I'd definitely go for a GridLayout()
    4 * 4, with JLabels for the blank filler parts......
    So does this help

  • How to remove the last new line in text area ?

    I have a calculator Applet that shows the calculation in a text area.
    if i enter 2+6, the text area shows
    2+
    6
    and i have a clear last button, which deletes the last entry by user.
    in the example above, one hit of clear last, deletes 6. another hit should delete +.
    I can delete the numbers, but I don't know how to go back to the previous line and delete the operator.
    I may have other calculations in that text area above the current calculation. so replaceAll("\n","") would not work here.
    Please someone help me here.

    it's an applet, i am developing in Eclipse ( mac environment)
    so for deleting a number i used this code, and works fine
    String temp = t.getText();
                             String lastChar = temp.substring(temp.length()-1);
                             for (int i=0; i<numbers.length; i++) // deleting a number
                                  if (lastChar.equals(numbers)){
                                       temp = temp.substring(0,temp.length()-1);
                                       number = number.substring(0,number.length()-1);
                                       t.setText(temp);
    which t is the text area, and numbers is the string array of 0 to 9, and number is a string where i store the entered number
    so i thought for deleting an operator i should use something similar, where i need to go back to the previous line and delete it,
    String temp = t.getText();
                             String lastChar = temp.substring(temp.length()-1);
                             if(lastChar.equals("n")){
                                                            temp = temp.substring(0,temp.length()-3);// deleting n , \ , and the operator
                                       t.setText(temp);
                             } but it doesn't work

  • Report Builder SQL Queries - Convert CN to clear text

    I am trying to customize a query in Report Builder to message values as they are delivered, and running into value expression errors.
    My query returns data from the AD Computer Object "managedBy" field. The problem is that this field returns data in the format of:
    CN=Security Group Name,OU=blah,OU=blah,DC=stuff,DC=com etc
    I am trying to get it to return just the "Security Group" value which is much more useful. I found this great article which almost works for me: https://social.technet.microsoft.com/forums/systemcenter/en-US/6610d238-72f2-4e75-a0cc-e1383dd8e94b/ad-system-discovery-convert-cn-to-clear-text
    However, once I try to save the report in Report Builder I get:
    System.Web.Services.Protocols.SoapException: The Value expression for the text box ‘managedBy0’ refers to the field ‘managedBy0’.  Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified
    dataset scope. Letters in the names of fields must use the correct case.
    This is the original SQL query:
    select  all SMS_R_System.Name0,SMS_R_System.managedBy0,SMS_R_System.description0,SMS_G_System_OPERATING_SYSTEM.Caption00,SMS_R_System.Resource_Domain_OR_Workgr0,SMS_R_System.whenCreated0,SMS_R_System.Last_Logon_Timestamp0 from vSMS_R_System AS SMS_R_System
    INNER JOIN Operating_System_DATA AS SMS_G_System_OPERATING_SYSTEM ON SMS_G_System_OPERATING_SYSTEM.MachineID = SMS_R_System.ItemKey  INNER JOIN _RES_COLL_CAS000A9 AS SMS_CM_RES_COLL_CAS000A9 ON SMS_CM_RES_COLL_CAS000A9.MachineID = SMS_R_System.ItemKey
    My edited query:
    select  all SMS_R_System.Name0,REPLACE(SUBSTRING(SMS_R_System.managedBy0,4,CHARINDEX(',OU',SMS_R_System.managedBy0,3)-4),'\,',','),SMS_R_System.description0,SMS_G_System_OPERATING_SYSTEM.Caption00,SMS_R_System.Resource_Domain_OR_Workgr0,SMS_R_System.whenCreated0,SMS_R_System.Last_Logon_Timestamp0
    from vSMS_R_System AS SMS_R_System INNER JOIN Operating_System_DATA AS SMS_G_System_OPERATING_SYSTEM ON SMS_G_System_OPERATING_SYSTEM.MachineID = SMS_R_System.ItemKey  INNER JOIN _RES_COLL_CAS000A9 AS SMS_CM_RES_COLL_CAS000A9 ON SMS_CM_RES_COLL_CAS000A9.MachineID
    = SMS_R_System.ItemKey
    Thoughts?

    Hey,
    Since you manipulate the original value of
    ManagedBy0 in your SELECT, the column name will change to
    (No column name). I did a test on my side and look what I get.
    Error : "The Value expression for the text box ‘managedBy0’ refers to the field ‘managedBy0’."
    He search for a variable
    ManagedBy0 in your query but don't find any because there's no name assigned.
    Try to run this query. Add
    AS ManagedBy0 after your REPLACE. 
    select all
    SMS_R_System.Name0,
    REPLACE(SUBSTRING(SMS_R_System.managedBy0,4,CHARINDEX(',OU',SMS_R_System.managedBy0,3)-4),'\,',',') AS ManagedBy0,
    SMS_R_System.description0,
    SMS_G_System_OPERATING_SYSTEM.Caption00,
    SMS_R_System.Resource_Domain_OR_Workgr0,
    SMS_R_System.whenCreated0,
    SMS_R_System.Last_Logon_Timestamp0 from vSMS_R_System AS SMS_R_System INNER JOIN Operating_System_DATA AS SMS_G_System_OPERATING_SYSTEM ON SMS_G_System_OPERATING_SYSTEM.MachineID = SMS_R_System.ItemKey INNER JOIN _RES_COLL_CAS000A9 AS SMS_CM_RES_COLL_CAS000A9 ON SMS_CM_RES_COLL_CAS000A9.MachineID = SMS_R_System.ItemKey
    Let me know.
    Nick Pilon | Blog : System Center Dudes

  • Clearing text items

    hi
    I have some text items, user enters data into these text item and presses ok button.
    After that the data is inserted into the database, but the text items are not cleared.
    What should I do to clear text items after an insert?

    Ricardinho wrote:
    one last question:
    During insert, I runinto an error message:
    INSERT INTO DRV(DRIVER_NO,DRIVER_NAME,VEHICLE_REGISTER,DRIVER_CERTIFICATE,DRIVER_ABN,ADDRESS,PHONE,*DRIVER_NUMBER*,*VEHICLE*,*VOUCHER*) VALUES (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10)
    ORA-00904: Voucher invalid identifier
    Eventhough I delete DRIVER_NUMBER,VEHICLE,VOUCHER items from the database and from the datablock, I still got this error message?
    Any idea?ORA-00904 is the error code for invalid identifiers, your SQL clearly showing that the block still has the three columns as database items in your block.
    make sure you don't have in any block the items set as database items.
    Tony

  • URGENT: Entering Chinese into Java Text Area

    Hi,
    This might be an FAQ question but some of the info I've gotten over the web so far is conflicting.
    How do I allow a user to enter Chinese text into a Java Text Area (using an english keyboard)?
    All my users have:
    English Windows 2000 with a multilanguage pack. I cannot change this.
    But, I can specify any downloads (IMEs, etc.) and I can choose whichever version of Java I desire.
    Please let me know what is the simplist way to enable Chinese data entry in this environment. Let me know if I need to create my own input type :( or I can use MS Global IME) or if there are other third party chinese input types (even if they are not free).
    Thank you and have a nice day.
    Best Regards,
    Carlos

    Thanks for the note. The news was depressing - but things are much clearer now :) I would like one more clarification, though -
    On the MS site, I quote
    Any user who needs to input East Asian text across the language platforms of Windows Me, Windows 98, Windows 95, or Windows NT 4.0 could use Global IME.
    "Note: On Windows 2000, the Global IMEs work in any application since that OS has full-featured East Asian input support built in. On Windows Millennium, Windows 98, Windows 95, and Windows NT 4.0, the Global IMEs work only in supporting applications."
    When they say they say "full-featured East Asian input support built-in" does that exclude Java? If it would work, would it work with Swing or only AWT?
    Any thoughts? Thanks again for your not, I would greatly appreciate it if you could help me with this clarification.
    Best Regards,
    Carlos

  • How can i put text/chars inside a text area inside a JScrollPane?

    ive tried:
    receipt.setText("blah blah") // but it does not work. all i get is still a blank text area inside a JScrollPane
    JTextArea receipt;
    JScrollPane sp;
    receipt = new JTextArea();
    sp = new JScrollPane(receipt,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);

    mstrnew = new JButton //this should clear receipt
    if(evnt.getSource()==mstrnew)
                  order.setText("");
                  price.setText("");
                  total.setText("0.0");
                  cash.setText("");
                  change.setText("");
                  mstrtotal = 0;
                  JOptionPane.showMessageDialog(null,"              Starting New Transaction...","",JOptionPane.PLAIN_MESSAGE);    receipt.setText("");}
    else if(evnt.getSource()==vm1)
                  generate("           2pc. Chicken Strips Meal\n");
                  order.setText("2pc. Chicken Strips");
                  price.setText("61.0");
                  mstrtotal = Double.parseDouble(price.getText()) + Double.parseDouble(total.getText());
                  total.setText(String.valueOf(mstrtotal));
    // scrollpane part
                 receipt = new JTextArea();
                 receipt.setEditable(true);
                 //receipt.setLineWrap(true);
             up = "\n          YUM! Brands Corporation, Kentucky Fried Chicken ?\n                       KFC LaSalle Branch, Taft Ave., Manila\n\n           88788   TIN-209-670-390-002   REG VAT   POS#113\n           SN:41-HK170 All prices were subjected of 12% VAT.";
             mid = "\n\n";
             down = "\n";
             complete = up+mid+down;
             receipt.setText(complete);
             sp = new JScrollPane(receipt,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    public void generate(String z)
             mid += z;
             complete = up+mid+down;
        }Message was edited by:
    ice3d

  • The attribute inserted some time in base64 and some time in clearly text

    Hi to all,
    i have a problem with insert attributes in my ldap.
    The attribute are defined in this way:
    attributeTypes: ( spadaId-oid NAME 'spadaId' SYNTAX 1.3.6.1.4.1.1466.115.121.1.
    15 SINGLE-VALUE X-ORIGIN 'user defined' )
    But if i exec many add, the same attribute, are inserted some time encoded in base64, and some time in clearly text.
    Can you help me?
    I know that my english is far from being perfect, but I hope that you understood the problem
    Thanks

    Hi to all,
    i have a problem with insert attributes in my ldap.
    The attribute are defined in this way:
    attributeTypes: ( spadaId-oid NAME 'spadaId' SYNTAX
    1.3.6.1.4.1.1466.115.121.1.
    15 SINGLE-VALUE X-ORIGIN 'user defined' )
    But if i exec many add, the same attribute, are
    inserted some time encoded in base64, and some time
    in clearly text.
    Can you help me?
    I know that my english is far from being perfect, but
    I hope that you understood the problem
    ThanksIf you are viewing the attribute value in LDIF format then values which are in non-ascii format ("SAFE-UTF8-CHAR", as per the RFC) will be in base64 encoded (refer RFC 2849 )
    -------- RFC 2849 Note-------
    4) Any dn or rdn that contains characters other than those
    defined as "SAFE-UTF8-CHAR", or begins with a character other
    than those defined as "SAFE-INIT-UTF8-CHAR", above, MUST be
    base-64 encoded. Other values MAY be base-64 encoded. Any
    value that contains characters other than those defined as
    "SAFE-CHAR", or begins with a character other than those
    defined as "SAFE-INIT-CHAR", above, MUST be base-64 encoded.
    Other values MAY be base-64 encoded.
    8) Values or distinguished names that end with SPACE SHOULD be
    base-64 encoded.
    Regards
    Randip Malakar

Maybe you are looking for

  • Satellite P100: Conexant audio is not supported on Windows Vista 64bit

    Last week I install the new system as Windows Vista 64bit but no sound. I think that was the problem with the 64bit audio driver. Is that anyone has the new driver for vista 64bit?

  • Sqlplus command using a query instead of a sql file

    can any body guide me?..i want to execute the sql query using sqlplus without using a sql file. for example following command is valid: sqlplus abc/abc@abc @abc.sql but i want sqlplus abc/abc@abc @(select * from abc) i will be thankful if any body ca

  • JPA: IN parameter to take in a Collection

    Hi, I am wondering whether in latest Toplink Essentials this issue (reproduced below for convenience) https://glassfish.dev.java.net/issues/show_bug.cgi?id=2484 has been fixed: "For instance, the query "SELECT i FROM Person i WHERE i.address IN (:col

  • Build and test Flex 4 in Hudson?

    Hi May I know how to build and test Flex 4 web application in the continuous integration server like Hudson? I think tutorials have been describing of how to develop Flex 4 application using Flash Builder. Is it possible to build Flex application fro

  • Statistical flow

    Hi Please help me! I try to define Cash Flow item as statistical flow but I don't know which debit or credit sign assign? For Balance and P&L it is clearly defined in help which sign to use, but for statistical flow no! For example for CF item: Incre