How can I get a match text effect in a Choice

How can I get a match text effect in a Choice; I mean, for instance, that if a type a "p" the first choice item that begins with a "p" should be automatically selected

Here is a pretty simple example. Keep in mind that I am coverting all comparison characters to UpperCase. If you allow LowerCase characters in you Choice items then remove the appropriate Character.toUpperCase() calls.
Hope this helps
Mike
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class TestApplet extends Applet implements KeyListener {
     private Choice choice;
     public void init()
          setLayout(new FlowLayout());
          choice = new Choice();
          choice.add("Aaron");
          choice.add("Adam");
          choice.add("David");
          choice.add("Mike");
          choice.addKeyListener(this);
          add(choice);
     public void keyPressed(KeyEvent e)
          int current = choice.getSelectedIndex();
          int x = 0;
          char c = Character.toUpperCase(e.getKeyChar());
          while(x<choice.getItemCount()) {
               if(c == Character.toUpperCase(choice.getItem(x).charAt(0))) {
                    current = x;
                    break;
               x++;
          choice.select(current);
     public void keyReleased(KeyEvent e) { }
     public void keyTyped(KeyEvent e) { }
}

Similar Messages

  • How can u get the matching percentage whenever compare the pdf files(compare the strings)

    Actually I want matching percentage whenever compare the pdf files.First I had completed 
    read the pdf files content into string
    my code like as
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.IO;
    using iTextSharp.text;
    using iTextSharp.text.pdf;
    using iTextSharp.text.pdf.parser;
    namespace WindowsFormsApplication1
    public partial class Form1 : Form
    string str1;
    string filename;
    string path;
    string str2;
    public Form1()
    InitializeComponent();
    private void button1_Click(object sender, EventArgs e)
    OpenFileDialog openFileDialog = new OpenFileDialog();
    openFileDialog.CheckFileExists = true;
    openFileDialog.AddExtension = true;
    openFileDialog.Filter = "PDF files (*.pdf)|*.pdf";
    DialogResult result = openFileDialog.ShowDialog();
    if (result == DialogResult.OK)
    filename = Path.GetFileName(openFileDialog.FileName);
    path = Path.GetDirectoryName(openFileDialog.FileName);
    textBox1.Text = path + "\\" + filename;
    private void button2_Click(object sender, EventArgs e)
    OpenFileDialog openFileDialog = new OpenFileDialog();
    openFileDialog.CheckFileExists = true;
    openFileDialog.AddExtension = true;
    openFileDialog.Filter = "PDF files (*.pdf)|*.pdf";
    DialogResult result = openFileDialog.ShowDialog();
    if (result == DialogResult.OK)
    filename = Path.GetFileName(openFileDialog.FileName);
    path = Path.GetDirectoryName(openFileDialog.FileName);
    textBox2.Text = path + "\\" + filename;
    public static string ExtractTextFromPdf(string filename)
    using (PdfReader r = new PdfReader(filename))
    StringBuilder text = new StringBuilder();
    for (int i = 1; i <= r.NumberOfPages; i++)
    text.Append(PdfTextExtractor.GetTextFromPage(r, i));
    string result = text.ToString();
    return result;
    public static string Extract(string filename)
    using (PdfReader r = new PdfReader(filename))
    StringBuilder text = new StringBuilder();
    for (int i = 1; i <= r.NumberOfPages; i++)
    text.Append(PdfTextExtractor.GetTextFromPage(r, i));
    string result1 = text.ToString();
    return result1;
    private void button3_Click(object sender, EventArgs e)
    str1 = Form1.ExtractTextFromPdf(textBox1.Text);
    str2 = Form1.Extract(textBox2.Text);
    }Finally how can u get the matching percentage whenever compare the pdf files(compare the strings)please help me.thank u

    Hi,
    Based on your code, I see your code related to
    iTextSharp Pdf.
    iText is a third party library to create PDF originally written for java. iTextSharp is
    the C# adaptation of that library.
    Question regarding iText are better asked on the iText forum, rather than the Microsoft Forum:
    http://itextpdf.com/support
    Thanks for your understanding.
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How can I get just the text to resize, rather than the entire web page?

    I used to be able to re-size just text on a webpage by typing Ctrl + +. Today, the entire webpage re-sizes, and when I move to another page it reverts. (I see this mostly in Facebook.). Why did this change, and can I go back to having just the text re-size?

    ''How can I get just the text to resize -- zoom text only''
    steps
    #"Alt" if no menu bar, then
    # View > Zoom > Zoom Text Only
    Zoom text of web pages - MozillaZine Knowledge Base
    :http://kb.mozillazine.org/Zoom_text_of_web_pages
    <br><small>Please mark "Solved" one answer that will best help others with a similar problem -- hope this was it.</small>

  • How can I get the pluginID in Effect type plugins?

    Hi,
    I am craeting Effcet plugin and I want to get the PluginID because I want to execute the script file using AEGP_ExecuteScript() function?.
    so Could you please tell me how can I get the pluginID in Effect plugins?
    Thanks
    Manjunath G

    Hi Mylenium,
    Thanks for your reply.
    see the below function prototype...
    SPAPI A_Err (*AEGP_ExecuteScript)(AEGP_PluginID inPlugin_id, const A_char* inScriptZ,// in const A_Boolean latform_encodingB,// in AEGP_MemHandle* outResultPH0, AEGP_MemHandle* outErrorStringPH0);
    I am developing a Effect plugin and I want to execute the script by using above function. So, How can I get the pluginID from the AfterEffects?
    I have seen the sample SDK projects. In the AEGP (floder) SDK samples, the EntryPointFunc function prototype itself there is a pluginID.
    See the EntryPointFunc() prototype...
    EntryPointFunc( struct SPBasicSuite *pica_basicP, A_long major_versionL,
    A_long minor_versionL,
    const A_char *file_pathZ, const A_char *res_pathZ,
    AEGP_PluginID aegp_plugin_id, void *global_refconPV);
    I hope, you understood my problem?
    Thanks
    Manjunath

  • How can I get rid of shimmer effect in videos that I create in iMovie?

    How can I get rid of shimmer effect in videos that I create from photos in iMovie?

    Well, not sure - so exactly what resolution do you use to shoot? Go in your camera settings and check. And, is there a settings to choose for regular/extra/fine/superfine quality? I shoot at the highest quality - period. My size/resolution is either widescreen or larger than what I need for the movie. My TV is HD 720p - that means the screen will display 1200 x 720 pixels in HD; if you have a 1080p, it'd be 1920 x 1080. So shoot in a size a bit larger than that because they can be adjusted down without any quality loss, but can't be made larger without significant loss of quality.
    But,again, the problem usually doesn't start until you add movement, but camera quality has something to do with it as well. I know that a previous camera I had was not as good and a lot of my slideshows/movies didn't come out as perfect as I would have liked. So I bought a more expensive camera - shoots in full 1080 HD and I haven't had a problem since.
    As for exporting a slideshow: finish it in Photo to Movie and export to desktop at highest quality (will take a while). Here is a screenshot of my export settings:
    Once done, you can simply choose that movie by going to "import movies" in iMovie and navigating to the location (I usually save to desktop - easy to find).

  • How can i get rid of sound effects icon in middle of screen?

    How can i get rid of sound effects icon in middle of screen?

    Have you tried restarting or resetting your iPad?
    Restart: Press On/Off button until the Slide to Power Off slider appears, select Slide to Power Off and, after the iPad shuts down, then press the On/Off button until the Apple logo appears.
    Reset: Press the Home and On/Off buttons at the same time and hold them until the Apple logo appears (about 10 seconds). Ignore the "Slide to power off".

  • How can I get my instructional text to display when I open the pdf?

    I have some fields which I have set up which have help/instructions for completing the information required.  This is a questionnaire.  When I save it as a pdf, the instsructional text does not display.  I would really appreciate if someone can tell me how to fix this.

    Thanks for taking the time to respond to my query.  The text does not display when I hover my mouse over it.
    cheers    Deborah Frow
          From: Ajlan huda <[email protected]>
    To: Deborah Frow <[email protected]>
    Sent: Monday, 12 January 2015, 5:24
    Subject: Reply marked as helpful on How can I get my instructional text to display when I open the pdf?
    |
    How can I get my instructional text to display when I open the pdf?
    Ajlan huda marked SumitV's reply on How can I get my instructional text to display when I open the pdf? as helpful. View the full replyMarked as helpful:Hi Pacific Immigration, In Adobe Acrobat/ Adobe Reader there is no “?” shown for help, but if you mouse over the field for 1-2 seconds the Help text is shown.
    Following How can I get my instructional text to display when I open the pdf? in these streams: Inbox
    |

  • How can I get Multi-color text it a swing componet?

    How can I get Multi-color text it a swing componet?
    I've tryed JTextPane and JEditorPane.
    If they support having text in more then one color then I don't see how.
    I want to make a color-coded Java editor in Java, but I can't color-code if I can only have one color.
    JComponent.setForeground(Color fg)
    is not what I need.
    maybe Java doesn't support it yet.
    but I hope it does.
    Please help, thanks.

    Hi,
    I've made you a little example with a coloured JEditorPane and JTextPane:
    import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.*;
    import java.awt.event.*;
    public class ColorDemo extends JFrame {
         public ColorDemo() {
              super("ColorDemo");
              // coloured JEditorPane
              JEditorPane editorPane = new JEditorPane("text/html",
                   "<FONT color=red> This </FONT>"+
                   "<FONT color=blue> is </FONT>"+
                   "<FONT color=green> a </FONT>"+
                   "<B> JEditorPane </B>");
              editorPane.setPreferredSize(new Dimension(250, 150));
              // coloured JTextPane
              JTextPane textPane = new JTextPane();
              textPane.setPreferredSize(new Dimension(250, 150));
              Document doc = textPane.getDocument();
              Style def = StyleContext.getDefaultStyleContext().
                   getStyle(StyleContext.DEFAULT_STYLE);
              try {
                   StyleConstants.setForeground(def, Color.blue);
                   doc.insertString (0, "This ", def);
                   StyleConstants.setForeground(def, Color.red);
                   doc.insertString (5, "is ", def);
                   StyleConstants.setForeground(def, Color.green);
                   doc.insertString (8, "a ", def);
                   StyleConstants.setBold(def, true);
                   StyleConstants.setForeground(def, Color.black);
                   doc.insertString (10, "JTextPane", def);
              } catch (Exception e) {}
              JPanel contentPane = new JPanel();
              contentPane.add(textPane);
              contentPane.add(editorPane);
              setContentPane(contentPane);
         public static void main(String[] args) {
              JFrame frame = new ColorDemo();
              frame.addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);
              frame.pack();
              frame.setVisible(true);
    }Hope this helps,
    Kurt.

  • How can I get trial for after effects 4? it is the only version my PC meets the requirements.

    How can I get trial for after effects 4?
    it is the only version my PC meets the requirements.

    Hello  yaniv7m,
    in my eyes you will find it only in shops like ebay or Amazon, like this:
    http://www.ebay.com/sch/i.html?_from=R40&_trksid=p2050601.m570.l1313.TR0.TRC0.H0.Xafter+ef fects+4&_nkw=after+effects+4&_sacat=0
    or
    http://www.amazon.com/Adobe-After-Effects-CS4-VERSION/dp/B001EUJ0SI/ref=sr_1_1?s=software& ie=UTF8&qid=1407396391&sr=1-1&keywords=after+effects+cs4
    Good luck!
    Hans-Günter

  • Using Export for Kindle, how can I get black body text to display inverse (white on black) on Kindle

    I'm using ID 5.5 on a Vista system.
    I've created a book file with some colored fonts and anchored gif images. Basic paragraph (body text) is black. The "Export to Kindle" mobi file displays fine on Kindle for PC and Kindle Previewer.
    Kindle PC alows viewing on white, sepia or black background. Works fine on white and sepia, but when the black color mode is selected (night viewing option) the black text does not display as white text. What can I do to have the black text automatically change to white?
    While trying to find a solution, I created an epub file of the book and, using Calibre, converted it to mobi. When this mobi file is loaded into Kindle PC, the black text does automatically change to white when viewed on the black screen. I would use this method of creating the mobi, but there are several other issues that make this process unsatisfactory (other text colors don't work well, image transparency losses, etc).
    So, how can I get the black to white text thing using only Export to Kindle?
    Jim

    Grayscale is probably the best (Settings>General>Accessibility>Grayscale)
    -Ethan
    EDIT: If you would like a black color scheme, use the suggestion in the reply above.

  • How can i get back the text of child

    I did an application to connect a db and show the datas in table.but the text of all such as button or textview seems disappear.how can I get them back?
    Here's the snap picture of my problem.
    http://img191.photo.163.com/rocboy_yang/13457324/655578057.jpg

    Hello Ty Lu,
    Have you hardcoded the text values for each button in the 'text' property of each button or are they assigned programaticaly from the context, are you using the message pool, perhaps for translation?
    Perhaps just right-clicking on your project in NWDS and selecting 'Reload' will straighten things out for you, give it a try.
    Regards,
    Patrick.

  • How can i get the correct text from a string like it show in the original source with the quotation marks in the right place ?

    The text is in hebrew so the problem is that sometimes the quotation marks not in the right place.
    For example i have this text: תווית
    על בגד: ''תן לאישה לכבס. זה תפקידה''
    This is the source original text you can see the quotations marks and they are not in the right place and all i did is copy paste.
    And this is a screenshot of how this text looks like in the website in the original:
    You can see now where the quotations marks should be.
    Now this is how i'm using the text in my program:
    First of all i'm using a webclient to download the page from the website and i'm also encoding it to windows-1255 since it's in hebrew.
    using (var webClient = new WebClient())
    webClient.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
    byte[] myDataBuffer = webClient.DownloadData("http://rotter.net/scoopscache.html");
    page = Encoding.GetEncoding("windows-1255").GetString(myDataBuffer);
    Then i'm extracting the places i need by reading the html file lines and parsing the right text and it's link.
    string loc;
    List<string> metas = new List<string>();
    List<string> metas1 = new List<string>();
    List<string> lockedLinks1 = new List<string>();
    string text = "";
    string mys = "";
    public List<string> LockedThreads(string filename)
    lockedThreads = new List<string>();
    lockedLinks = new List<string>();
    Regex textRegex = new Regex("ToolTip.*?(?=','<)");
    string[] fall = File.ReadAllLines(filename);
    for (int i = 0; i < fall.Length; i++)
    if (fall[i].Contains("http://rotter.net") && fall[i].Contains("locked")||
    fall[i].Contains("locked_icon_general") ||
    fall[i].Contains("locked_icon_anchor") ||
    fall[i].Contains("icon_anchor") ||
    fall[i].Contains("locked_icon_fire") ||
    fall[i].Contains("locked_icon_sport") ||
    fall[i].Contains("locked_icon_camera") ||
    fall[i].Contains("locked_icon_movie"))
    Regex linkParser = new Regex(@"\b(?:https?://|www\.)\S+\b", RegexOptions.Compiled | RegexOptions.IgnoreCase);
    foreach (Match m in linkParser.Matches(fall[i + 2]))
    if (m.Value.Contains("><b"))
    loc = m.Value.Replace("\"><b", string.Empty);
    lockedLinks.Add(loc);
    string txt = fall[i - 1];
    string text = textRegex.Match(txt).Value.Replace("ToolTip','", String.Empty);
    if (text.Contains("&rsquo;"))
    text = text.Replace("&rsquo;", string.Empty);
    lockedThreads.Add(text);
    Already here on the List lockedThreads you can see the quotation marks not in the right place as in the original:
    After i'm parsing the text and links and adding them to the Lists in another class i'm doing a comparison using this Lists:
    foreach (List<string> l_branch in ListsExtractions.responsers)
    TreeNode l_node = treeView1.Nodes.Add(l_branch[l_branch.Count - 1]);
    if (ListsExtractions.lockedThreads.Contains(l_node.Text))
    l_node.ImageIndex = 0;
    l_node.SelectedImageIndex = 0;
    for (int l_count = 0; l_count < l_branch.Count - 1; l_count++)
    TreeNode l_subnode = l_node.Nodes.Add(l_branch[l_count]);
    if (ListsExtractions.lockedThreads.Contains(l_subnode.Text))
    l_subnode.ImageIndex = 0;
    l_subnode.SelectedImageIndex = 0;
    The problem is in the line:
    if (ListsExtractions.lockedThreads.Contains(l_node.Text))
    When it's getting to the line with the quotation marks it's never equal.
    Now there are more quotation marks.
    In general the problem when comparing both text if it's having quotation marks it's not the same.
    So i have two options:
    1. To fix it somehow so the quotation marks will be the same in both variables when comparing and also the same like in the original as they show in the html page.
    2. To remove the quotation marks from both variables.
    What should i do ? And how ? I was prefer to use the original quotation marks like in the original since they have a meaning in the place they should be. The question is how can i do it ?
    This is example of the block from the html file where the text with the quotation marks is:
    <TD ALIGN="RIGHT" VALIGN="TOP">&nbsp;<font size=-1 color=#ff9933><b>9418</b></font>&nbsp;</TD></TR><TR BGCOLOR="#eeeeee">
    <TD ALIGN="RIGHT" VALIGN="TOP">
    <body onmousemove="overhere()">
    <a onmouseover="EnterContent('ToolTip','תווית על בגד: &rsquo;&rsquo;תן לאישה לכבס. זה תפקידה&rsquo;&rsquo;','<u><span style=color:#000099;>כתב: Spook בתאריך: 08.03.15 שעה: 22:11</span></u><br>מחאת טוויטר קמה בעקבות תוויות שוביניסטיות שהדפיסה חברת אופנה באינדונזיה לפיהן תפקיד הכביסה מוטל על האישה. החברה התנצלה אך כנראה רק עשתה רק יותר נזק לע...'); Activate();" onmouseout="deActivate()" href="javascript:void(0)">
    <img src="http://rotter.net/forum/Images/new_locked_icon_general.gif" border="0"></a></TD><TD ALIGN="right" VALIGN="TOP" WIDTH="55%">
    <FONT CLASS='text15bn'><FONT FACE="Arial">
    <a href="http://rotter.net/cgi-bin/forum/dcboard.cgi?az=read_count&om=189696&forum=scoops1"><b>
    <font color="898A8E">תווית על בגד: ''תן לאישה לכבס. זה תפקידה''</b>
    </a></font></TD>

    Ok, it is unclear on what is happening here.
    Are you saying that when the webclient gets the data that it is not honoring the quote characters? Or the processing of the data buffer is causing issues?
    This is what I see the of your example text which is trying to be parse out:
    <a onmouseover="EnterContent('ToolTip','תווית על בגד: &rsquo;&rsquo;תן לאישה לכבס. זה תפקידה&rsquo;&rsquo;','<u><span style=color:#000099;>כתב: Spook בתאריך: 08.03.15 שעה: 22:11</span></u><br>מחאת טוויטר קמה בעקבות תוויות שוביניסטיות שהדפיסה חברת אופנה באינדונזיה לפיהן תפקיד הכביסה מוטל על האישה. החברה התנצלה אך כנראה רק עשתה רק יותר נזק לע...'); Activate();">";
    It appears to me that the  escapes `&rsquo;` does not have matching `&ldquo;` anywhere within the tooltip. So it appears that the page properly places left quotes in when processing the page, but the raw html has broken text.
    Hence a garbage in, garbage out situation.
    William Wegerson (www.OmegaCoder.Com)

  • How can i get the correct text from the url which has the mulitp-languages?

    hi, all
    i built a application and deployed it on sun application server 8.1. when i request a url which include some multi-languages (for example http://xxx.com/servlet?value=XXX. the 'XXX' may be simply chinese. ), i got the ??? instead of the correct text. how can i do it? in tomcat server, i can set the URIEncoding=GBK to get the correct code in server.xml. how can i do it in sun app server?
    thanks.

    Ok, it is unclear on what is happening here.
    Are you saying that when the webclient gets the data that it is not honoring the quote characters? Or the processing of the data buffer is causing issues?
    This is what I see the of your example text which is trying to be parse out:
    <a onmouseover="EnterContent('ToolTip','תווית על בגד: &rsquo;&rsquo;תן לאישה לכבס. זה תפקידה&rsquo;&rsquo;','<u><span style=color:#000099;>כתב: Spook בתאריך: 08.03.15 שעה: 22:11</span></u><br>מחאת טוויטר קמה בעקבות תוויות שוביניסטיות שהדפיסה חברת אופנה באינדונזיה לפיהן תפקיד הכביסה מוטל על האישה. החברה התנצלה אך כנראה רק עשתה רק יותר נזק לע...'); Activate();">";
    It appears to me that the  escapes `&rsquo;` does not have matching `&ldquo;` anywhere within the tooltip. So it appears that the page properly places left quotes in when processing the page, but the raw html has broken text.
    Hence a garbage in, garbage out situation.
    William Wegerson (www.OmegaCoder.Com)

  • How can I get High Lighted text from JTextPane?

    I can get Selected text when right click.
    But, I have to get high lighted text without Right click.
    How can I do this?
    Is it possible any way?

    Hi,
    you could try it with Document doc = editor.getDocument();
    int start = editor.getSelectionStart();
    String selectedText = doc.getText(start, editor.getSelectionEnd() - start);(editor above being your JTextPane).
    Ulrich

  • How can i get order long text?

    Hi Experts
                 We are developing one order report and trying to get order long text, but we search several tables and we didn't fine which table is the right table to save long text, anyone can tell me how to achieve long text for order.  Thanks in advance.
    Best regards
    george

    Hi George,
    STXL: Long Text (Header - English)
    Extract all records where XTDOBJECT='AUFK' and XTDID='KOPF' and XTDSPRAS in ('E')
    XTDNAME is MANDT+AUFNR
    STXL: Long Text (Operations- English)
    Extract all records where XTDOBJECT='AUFK' and XTDID='AVOT' and XTDSPRAS in ('E')
    XTDNAME is MANDTAUFPLAPLZL
    STXL: Long Text (Components- English)
    Extract all records where XTDOBJECT='AUFK' and XTDID='MATK' and XTDSPRAS in ('E')
    XTDNAME is MANDTRSNUMRSPOS
    This may help you
    Babu

Maybe you are looking for

  • Music bought with a defunt apple ID

    I have a couple albums bought years ago under a now defunct apple ID. This was the family account, which no longer exists. I simply started using my own six years ago or so. My old laptop (7.5 years!) was authorized under both, so there was never any

  • Where is my "surround mixer/ biagnostic/ grafix equalizer butto

    When I am watching a movie, my rear and side speakers are not loud enough. I swear I used to be able to control the front/side/rear speaker volume. When I open up the Creative software I noticed I am missing tabs next to the (default) tab. All I have

  • Abrupt log outs

    In the past week I've been traveling and have been using a Verizon aircard to access the Internet.  At least three times in that period I was suddenly logged out by the machine while performing various tasks--iChat, email drafts, Word editing--all un

  • Regarding Input text fields

    This is about fill in the blanks in flash 8 as2. In this i used input  text fields and three buttons.In first frame i used multiple input text  fields and a submit button. After filling all the blanks we click on  submit button then in the second fra

  • Anyconnect 802.1x - "switch user" is blocked in machine authentication

    hi all, I know this is not a bug its a feature that anyconnect blocks user switching disallowing the computer to have them both logged in. Its desirable and understandable however I have an environment where I use only machine authentication and remo