Re: trying to set the month of a JComboBox

I am reading in from a file
Note my problem is trying to set the month of a JComboBox.
try
{ BufferedReader myinp;
myinp = new BufferedReader( new FileReader("myfile2.txt"));
while ((str = myinp.readLine()) !=null)
StringTokenizer st = new StringTokenizer(str, "\t");
txtfdInitials.setText(st.nextToken());
int expireday = Integer.parseInt( st.nextToken() );
for (int i = 0; i < 31; i++)
if ( Integer.parseInt(days) == expireday)
cdp.getComboDay().setSelectedIndex(expireday-1); // with days it is easy cos its int
String expiremonth = st.nextToken();
for (int i = 0; i < months.length; i++)
if (months[i].equals(expiremonth) )
//please help here
//for exmaple if expire month is March
// i want to do something like
//cdp.getComboDay().setSelectedIndex(2);
//it is easy to do with days as this is an integer but how can I do it with months.
// please help
myinp.close();
catch(IOException e)
{ System.err.println("Exception: " + e.getMessage());
System.exit(1);
Thanks in advance

sorry to all the experts,
At present I can't see the wood for the trees.
Have a lot on my plate.
Ignore the message:
String expiremonth = st.nextToken();
for (int i = 0; i < months.length; i++)
if (months.equals(expiremonth) )
cdp.getComboMonth().setSelectedIndex(i);
}

Similar Messages

  • On the initial set up for apple tv it just sits there trying to set the date and time . it is a wireless setup and the ipaddress and router address is correct . I can't get by this screen

    On the initial set up for apple tv it just sits there trying to set the date and time . it is a wireless setup and the ipaddress and router address is correct . I can't get by this screen. The setting is on automatic and I have picked a city in my time zone yet it still tries to set a time and date but fails.
    thanks

    Make sure router is up to date. Try ethernet to rule out any wifi issues. Reboot ATV and router.

  • Novice Trying to Set The CLASSPATH Variable

    I am trying to compile a file (which can be downloaded at http://java.sun.com/docs/books/tutorial/getStarted/QandE/FirstClass.java). Despite being able to successfully compile several other files, this particular one will not compile. According to my JAVA Tutorial book, the problem may lie in the CLASSPATH variable, but I am having a great deal of trouble trying to set/understand it. My operating system is WINDOWS 2000. PLEASE HELP!!!

    in win 2000, the classpath can be set by the following process.
    Right Click My Computer icon and click on properties.
    (This can be done by going to the Control Panel and Double Clicking the System icon too).
    Once you have the properties window of the system click on the 'Advanced' tab.
    There is a button called 'Environment variables'.Click on it.
    You will have a part called 'System Variables' there.
    Here there is an entry called Classpath. Just add the entry of what you want to add to the classpath, separating each entry with a ';' semicolon as mentioned there and click on the Set button.
    That should set the classpath.If that does not take effect immediately, restart the system and it will take effect.
    Tell me if it worx.
    All the best. Bye!
    Cheers,
    Win!

  • Error when tried to set the PreserveSequence property in a map to "yes"

    Hi there,
    I have a lab ORU^R01 msgs  that has multiple OBR and OBX segments, I tried to preserve the order by setting the PreserveSequence property but in run time i get this error:
    The variable or parameter "http://schemas.microsoft.com/Biztalk/2003/var:v14' is either not defined or it is out of scope.
    I have to geth this sorted as the users do not want them out of order.
    Can I get help on this please,
    sushma

    Hi Shushmakad,
    If you set Preserve Sequence Property=true. BizTalk will always expect source node will be in sequence, but you have option to change sequence of destination schema by updating xslt.
    Can you test your map with sample input message with sequence.  
    Debug xslt (use this url for reference) 
    http://msdn.microsoft.com/en-us/library/ms255602(v=vs.110).aspx
    Regards
    Suman

  • I'm trying to set the value of a textfield to a instance of another textfield in a repeating subform

    Hello all,
    I am trying set the value of a textfield in a repeating subform/table row to another textfield in a repeating subform with the corrosponding instance number.
    The user enters a list of Key Activities in the first part: -- KeyActivityRow is the repeating subform --
    xfa.resolveNode("form1.#subform.KeyActivities.Row1.Table2.KeyActivityRow.Cell2")
    -- KeyActivityRow is the repeating subform --
    Which then Populates the corresponding occurence of:  --
    xfa.resolveNode("form1.#subform.ActivityTable.HeaderRow.Table1.HeaderRow.Cell1")
    -- ActivityTable is the repeating subform --
    Kevin

    In the calculate event of form1.#subform.ActivityTable.HeaderRow.Table1.HeaderR ow.Cell1 enter this script in Language:JavaScript :
    this.rawValue=xfa.resolveNode("form1.#subform.KeyActivities.Row1.Table2.KeyActivityRow["+A ctivityTable.index+"].Cell2").rawValue
    Kyle

  • Scope issue: Trying to set the value of a variable in a calling (upper) script from a called (lower) script

    Hi,
    I have a basic scope question . I have two .ksh scripts. One calls the other.
    I have a variable I define in script_one.ksh called var1.
    I set it equal to 1. so export var1=1
    I then call script_two,ksh from script_one.ksh.  In script_two.ksh I set the value of var1 to 2 . so var1=2.
    I return to script_one.ksh and echo out var1 and it still is equal to 1.
    How can I change the value of var1 in script_two.ksh to 2 and have that change reflected in script_one.ksh when I echo var1 out after returning from script_two.ksh.
    I've remember seeing this I just can't remember how to do it.
    Thanks in advance.

    Unfortunately Unix or Linux does not have a concept of dynamic system kernel or global variables.
    Environment variables can be exported from a parent to a child processes, similar to copying, but a child process cannot change the shell environment of its parent process.
    However, there are a few ways you could use: You can source execute the scripts, using the Bash source command or by typing . space filename. When source executing a script, the content of the script are run in the current shell, similar to typing the commands at the command prompt.
    Use shell functions instead of forking shell scripts.
    Store the output of a script into a variable. For instance:
    #test1.sh
    var=goodbye
    echo $var
    #test2.sh
    var=hello
    echo $var
    var=`./test1.sh`
    echo $var
    $ ./test2.sh
    hello
    goodbye

  • Help.... trying to set the browser title for reports called from 9i form

    hello all
    I am attempting to call a 9i report from an oracle 9i form .I am using the following code
    repid := find_report_object('report5');
    SET_REPORT_OBJECT_PROPERTY
    SET_REPORT_OBJECT_PROPERTY (repid,REPORT_type,CACHE);
    SET_REPORT_OBJECT_PROPERTY (repid,REPORT_DESFORMAT,pdf);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,'sandy4');
    v_rep := RUN_REPORT_OBJECT(repid,p1_id);
    IF rep_status = 'FINISHED' THEN
    /*Display report in the browser*/
    WEB.SHOW_DOCUMENT('http://----.--------.com:8888/reports/rwservlet/getjobid'|| substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=sandy4,'_blank');
    .. and so on
    The reports RUNS FINE AND POPS UP AS A NEAT PDF internet explorer page !!!
    I WAS WONDERING IF THERE IS ANYWAY TO SET THE BROWSER TITLE OF THIS REPORT THAT POPS UP..
    DO I HAVE TO CHANGE SOME PROPERTY AT THE REPORT END
    OR CAN I SET IT DYNAMICALLY BY PASSING AS A PARAMETER
    FROM MY FORM
    I HAVE SEARCHED EVERYWHERE FOR THIS
    PL HELP
    I WILL REALLY APPRECIATE IT IF SOMONE CUD HELP ME WITH
    THIS
    THANK YOU
    SANDY

    Hi,
    It is possible to set the Document title for PDF output. Open the Reports Property Inspector, under PDF Document Taxonomy, you can set the Document title. But this does not show up in the browser when you open the document.
    thanks,
    Senthil

  • Trying to set the entity attributes in before commit and get the following

    i get the following error when i try to set the entity attributes before commit.
    JBO-28202: Entities invalidated in beforeCommit(). Need to re-validate and post.
    can somebody let me know, how to re-validate and post.

    I Suggest you set its Attribute on EOImpl, override doDML, and before call super.doDML set your Attribute. There is a special reason to set Attribute on beforeCommit?
    Best Regards

  • Trying to give the focus at my JComboBox

    Hey does somebody knows what i'm doing wrong,
    i have a JFrame with a JTextField and a JComboBox, i want to give the focus on startup to the JComboBox but the form gives it to my JTextField, here is my code to ask the focus for my JComboBox
    keuzeBox.addComponentListener(new ComponentAdapter(){
    public void ComponentShown(ComponentEvent ex){
    ((JComboBox)ex.getSource()).requestFocusInWindow();
    what am i doing wrong?

    I'm not sure if componentShown is applicable to JFrame class (as a lightweight component). The event seems to not be fired.
    Try this, as you mentioned you are displaying a JFrame, prefer to use a WindowFocusListener.
            frame.addWindowFocusListener(new WindowFocusListener() {
                public void windowGainedFocus(WindowEvent e) {
                    keuzeBox.requestFocus();
                public void windowLostFocus(WindowEvent e) {
            });

  • I'm trying  to download the monthly subscription versions of photoshop and lightroom, but I keep getting a server error message?  Any thoughts?

    Hey, I'm trying to download photoshop and lightroom for the subscription of $10 a month. but can't seem to get on the page for it. I keep getting a server error message, yet when I click the button to check their server it says everything is working fine.  Any ideas?

    Steveclack please see Error downloading Creative Cloud applications - http://helpx.adobe.com/creative-cloud/kb/error-downloading-cc-apps.html for information on how to resolve Error 207.

  • Trying to set the contents of a Text View in Objective-C

    Hi there,
    I have a properly linked up Text View (within a Scroll View) in Interface Builder, and I wish to change the value of that Text View at runtime.
    I am trying this code here, but it (and other similarities of it) is not working;
    [textField setObjectValue:@"Hello there user"];
    //or
    [textField setStringValue:@"Hello there user"];
    //or
    [textField setObjectValue:myString];
    When run, my app crashes and the console returns me with something like this;
    {quote}
    2008-04-12 11:23:43.040 Application Bugging Message Test[2251:10b] * -[NSScrollView setObjectValue:]: unrecognized selector sent to instance 0x12a490
    2008-04-12 11:23:43.041 Application Bugging Message Test[2251:10b] An uncaught exception was raised
    2008-04-12 11:23:43.041 Application Bugging Message Test[2251:10b] * -[NSScrollView setObjectValue:]: unrecognized selector sent to instance 0x12a490
    2008-04-12 11:23:43.041 Application Bugging Message Test[2251:10b] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[NSScrollView setObjectValue:]: unrecognized selector sent to instance 0x12a490'
    2008-04-12 11:23:43.042 Application Bugging Message Test[2251:10b] Stack: (
    2460484171,
    2484588795,
    2460513354,
    2460506700,
    2460506898,
    7997,
    2460543573,
    2524339906,
    2524299500,
    2524297805,
    2524296848,
    2524296654
    {quote}
    I have also tried changing the bindings in Interface Builder, but they make no difference, whether I link the Text View (which I think I should link to) or to the Scroll View.
    Any help would be greatly appreciated.
    Ricky.

    Of course!
    I am always getting mixed up when to use the prefixes - in this case;
    [textField getStringValue:variable1];
    Thanks for reminding me
    Ricky.

  • I tried to set the classpath, here is what I did, any help would be appreci

    javac -classpath/WINDOWS/Desktop/school/Java Projects/assignment2sem2/exercise9.10

    howdy.
    ok. this is a constant problem with newbies. i'm not picking on you but if you don't know how to figure out class paths then you have a fundamental lack of understanding of java. understanding class paths are at the core of the java language and using an IDE that supposedly controls this for you is not helping your situation. my suggestion to you is to use a text editor and the command prompt to create and run your java programs. you won't believe how much more you understand after fooling around with java this way for a few months.
    good luck.

  • I am trying to set the airport express with a printer; everything looks fine but I keep getting an error message, any tips??

    Do you know where the error message is coming from? All the set ups looks fine.
    Do you think I should reset everything and start from scratch?
    Cheers,
    JB

    An AirPort Express running firmware version 6.3 must be an old one. The Express is unrelated to Bluetooth, but it is likely that your wireless speaker signal is interfering with the Express's wireless signal. This is a common problem with wireless speakers and the older 2.4 GHz - only Express.
    The cure probably going to require upgrading your Express to a newer model, and using the relatively interference-free 5 GHz band.
    Read: Wi-Fi and Bluetooth: Potential sources of wireless interference
    NB:
    Sources of interference
    Wireless speakers that operate in the 2.4 GHz or 5 GHz band.

  • An error occurred while trying to set the security information, the error returned was Unspecified error (80004005)

    Hi,
    I am getting the following error in system center orchestrator when I assign permission to the run books.
    I run the designer with my admin account. I have bounced the server and check for every possible thing I can think of and still getting this error. It was working fine a couple of weeks ago.
    Has anyone seen error ?
    Appreciate any help you can give me.

    Hi,
    If you didn't change anything before the issue, I recommand check SQL server, especially for performance issue.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • Why does MScomctl.o​cx throw a server exception in my LabVIEW executable when trying to set the ImageList?

    I am using the Microsoft Toolbar Control 6.0 (SP4) toolbar to display 32x32 pixel buttons.
    In development, this toolbar works flawlessly. Once the program is compiled, however, the function iToolbar: ImageList(putRef) sometimes gives the error "Error -2147417851 occurred at The server threw an exception. "
    This error does not alway happen, and when it doesn't happen, everything works normally.
    Anyone have an idea why this error is being generated?

    I managed to strip away my entire application and limit the problem to just the toolbar and images. Please see file included.
    If you want to play with it, you will have to make a build script. Your system will need to have activex components installed.
    Mscomctl.ocx is required.
    As I said above, this code fragment works ok in LabVIEW development mode, but occasionally fails when built into an executable. When it fails, it seems to fail many times in a row. It doesn't seem to be a timing problem because there is only one thread.
    Has anyone else out there had this problem and found a solution?
    Message Edited by terminalman90 on 08-10-2005 11:34 AM
    Attachments:
    terminalman90.zip ‏37 KB

Maybe you are looking for

  • How to change xserve raid-card battery?

    how to change xserve raid-card battery?

  • Oracle Apps 11i Cloning with +ASM 10g Database

    Hi, Can somebody help Apps cloning on the issue facing. Please provide in detailed process Apps Cloning with +ASM. Trying to Clone 11i Apps environment(11.5.10.2) and Db 10.2.0.4. The database is on +ASM. 1. Copied all the application files from SOUR

  • BI admin tool - connect to a SharePoint list

    Dear users, is there any way to create sharepoint data source definition in bi admin tool? In my project I would like to retrieve data from sharepoint list. best regards.

  • Cirrus doesn't work

    Hi, I've started a project with cirrus server side ( http://vaeloran.com/chatClouds/lab/_naeo_chatClouds_web.html); I have a little problem that affects my website as well as the video phone sample (http://labs.adobe.com/technologies/cirrus/samples/)

  • Xi installation - database instance error

    hai everyone, while installing XI3.0, in the step database instance after specifying Exports DVD label.asc file i'am getting this error ERROR 2007-02-28 17:23:17 FSL-02015  Node C:/XI/DATA does not exist. ERROR 2007-02-28 17:23:17 MSC-01003  ESyExcep