Kindly help me with this Struts 1.0 and Ibatis issue

Hi All,
Hoping that this question will get posted.I am working on the example provided by http://www.reumann.net for the Ibatis.
I am using tomcat 5.0.28 , eclipse 3.0 and Java 1.4.2.I get the index page of the application
Once I click either of the links I get the following error on the browser.Http 500 eoor
"javax.servlet.ServletException: Cannot find bean under name departments
     org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
     org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
     org.apache.jsp.employeeForm_jsp._jspService(employeeForm_jsp.java:154)
     org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
     org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
     org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
     org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
     org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480)
     org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:506)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)"
It would be great if someone helps me out in detail as to what is to be done to get this application up and running.I am trying to use MS access database.
Many thanks in advance.
Thanking you
AS

AS,
I'll answer you here as I did on TSS. You need to pass a bean called "departments" in whichever scope you used in your jsp page.
As for a detailed explanation of how to integrate MSAccess, you'll probably need to read a few tutorials online. Ask again when you have specific questions that aren't answered by them.
sv

Similar Messages

  • I would like to remove a short gray edge from two images. I need help in that I am not yet able to use PhotoShop. Could somebody kindly help me with this?

    I would like to remove a short gray edge from two images. I need help in that I am not yet able to use PhotoShop. Could somebody kindly help me with this?

    I doubt it Doc Maik, but I am certainly happy to learn The image is this one (and a similar one). They would be beautiful portraits if not for the "extra mouth". The grey edge that I would like to remove is the excess of (grey) mouth that is actually my horse's chin, but that in the pictures looks like a wider, looping mouth. Practically, looking at the picture, the "extra mouth" to the left. What I would love it to be able correct that to look like a normal mouth, which means that half of the protruding edge should be removed. I am not sure I was able to explain myself, but here is one of the two pictures. I thank you for you kindness in being available to advise me.

  • Please Help me with this Struts Application

    Hi All,
    I am trying the lesson 1 in struttin with struts from http://www.reumann.net/struts/lesson1.do.
    For some reason I am not getting the values submitted on the studentForm.jsp to be displayed on the confirmation.jsp page.
    Can anyone help me out with this.
    This code doesnt seem to be working....
    <c:out value="${student.firstname}"/>
    Any help would be greatly appreciated.Please let me know whether you require the sources...
    Thanks
    AS

    <c:out> is not in Struts; I guess you are using JSTL as well. :)
    Richard.

  • Help needed with Windows 8.1 boot and recovery issue

    Hi. I hope someone can help me out with this Windows 8.1 issue. A friends computer (HP 2000-2c27CL Notebook) was badly infected and while I was able to do some cleaning in normal Windows I had to do some in Safe Mode. I was not being able to access Safe Mode so I went to Advanced Startup Options in Windows 8, Troubleshoot, then Advanced options, and finally the Command Prompt. Using the command prompt I typed "bcdedit /set {default} safeboot network" to have Safe Mode with Networking. Ever since I did that I haven't been able to get Windows to do a normal boot. I always get Safe Mode. I can't get back to Advanced Startup Options either. Via msconfig in Safe Mode I selected the Normal startup button on the General tab and selected apply and then ok. It then prompted me to restart the computer which I did. This did not fix the issue as I continue to get Safe Mode every time I start the computer. I also tried to do a complete system restore by typing "Recovery" in Windows 8 which brought up the HP Recovery Manager. Once in there I selected the Windows Recovery Environment and it prompted me to reboot the computer. I was expecting to get to an area where I could do a complete factory restore, but I again got booted into Safe Mode. What the heck is going on? The person who has this computer has no restore media... no USB or DVD discs made. There is however a recovery partition I believe, but as I said I can't do anything because I keep getting Safe Mode. Also I tried to use a antivirus emergency boot disk with this computer and I could not get it to boot from the DVDRom drive. I went into the BIOS and saw that Legacy is disabled and UEFI appears to be enabled by default. How am I to change the boot order to get it to boot from the disk and do scans for malware? I thought I did it correctly by moving the Rom drive to the top of the list, but that didn't work. I despise Windows 8x!!!
    Help with this is greatly appreciated. Thank you.

    Hi HPenn, welcome to the HP Forums. Unfortunately if you are unable to perform a recovery using any of the available methods:  Performing an HP System Recovery (Windows 8)
    You will have to order recovery media:  Order software and driver media
    I hope this helps.
    TwoPointOh
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the bottom to say “Thanks” for helping!

  • Kindly help me with this checkbox issue

    Hi all,
    Firstly I would like t o thank this very helpful forum.I have one more question regarding checkboxes.
    /*courses.jsp*/ In my courses.jsp which connects to an MS Access database I have something like this...
    <INPUT TYPE=CHECKBOX NAME="COURSES" VALUE="rs.getString("course")"><%out.print(rs.getString("course"));%></td>/*courses.jsp*/
    This is coming from the database.
    In my servlet code i have this in the doPost method.
    /*CheckBoxServlet*/ PS : This servlet is not connected to the database..
    String checkbox[] = request.getParameterValues("COURSES");
              int counter = checkbox.length;
              System.out.println("Number of checkboxes checked " + counter);
              if (checkbox !=null){
                   for (int i = 0; i < checkbox.length; i++) {
                   System.out.println("Checkbox values "+ checkbox);
         } else {
                   System.out.println("none selected");
    /*CheckBoxServlet*/
    /* OUTPUT */
    I have checked 5 check boxes
    Checkbox values rs.getString(
    Checkbox values rs.getString(
    Checkbox values rs.getString(
    Checkbox values rs.getString(
    Checkbox values rs.getString(
    /*OUTPUT*/
    My question is why is it not printing out the value in rs.getString()????.
    It would be great if this forum helps me in the right direction.Let me know how i can go about doing this.
    I hope i have explained my question correctly.If you have any further questions kindly ask.
    Thanking every one in adavance
    AS

    your mixing html and java code
    <INPUT TYPE=CHECKBOX NAME="COURSES"
    VALUE="rs.getString("course")"><%out.print(rs.getStrin
    g("course"));%></td>based on this it should be
    <INPUT TYPE=CHECKBOX NAME="COURSES"
    VALUE="<%out.print(rs.getString("course"));%>)"><%out.
    print(rs.getString("course"));%></td>
    Hi again,
    Thanks for the reply.
    If I give this
    <INPUT TYPE=CHECKBOX NAME="COURSES" VALUE="<%out.print(rs.getString("course"));%>"><%out.print(rs.getString("course"));%>This is the error message i get
    javax.servlet.ServletException: No data found
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
         org.apache.jsp.courses_jsp._jspService(courses_jsp.java:243)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         servlet.AdminValidationServlet.doGet(AdminValidationServlet.java:78)
         servlet.AdminValidationServlet.doPost(AdminValidationServlet.java:93)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.sql.SQLException: No data found
         sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7139)
         sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(JdbcOdbc.java:3908)
         sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(JdbcOdbcResultSet.java:5702)
         sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:356)
         sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:413)
         org.apache.jsp.courses_jsp._jspService(courses_jsp.java:106)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         servlet.AdminValidationServlet.doGet(AdminValidationServlet.java:78)
         servlet.AdminValidationServlet.doPost(AdminValidationServlet.java:93)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)What could be the reason for this.It would be great if you can help me out.
    TIA
    AS

  • Can someone please help me with this. Loading problems and error codes.

    I have several problems with itunes on my PC. I use 2 PC's and Iphone for work and I have an IPod nano. For about a week I have been having several problems with Itunes. The first problem is I cannot access the store, I get the loading screen and that is it. This screen lasts forever, nothing ever happens it just loads, and loads, and loads. . . .
    I try to sign in thinking that will help the loading issue and I get error message saying "We could not complete your itunes store request. An unknown error occurred (-50)." This happens on both computers. I also cannot download from my iphone, I get the same error message. Running diagnostics does nothing, itunes says everything is in working order. Uninstalling and reinstalling also does nothing. I have had itunes for years now and up until about 10 days ago had no problems. My itunes is not behind a firewall on either computer. I'm saying all of this because I would prefer not to get obvious answers or links that do not help me. Please someone has to know how to fix this.

    Welcome to discussions! This is the rather infamous chkdsk error which will require that you restore your iPod. The following link will give you a complete explanation/instructions.
    http://docs.info.apple.com/article.html?artnum=300554

  • I am facing this issues that music stops playing when the display goes...Please help me with this, I already reset and checked headphones still quits working.

    My IPod Nano stops playing music when display goes out.  I already tried the resolutions suggested and still having problem.  Please help!

    i've had my ipod for awhile and it just started doing this - last night.  it plays for about 30 seconds and stops.  i press play again and it restarts where it had stopped.  i had wondered if i had accidentally set it to 'sample' or something.

  • I have a red vertical line on the right side of my screen and it will not go away tried restarting my computer and that didn't help at all, please help me with this problem it is kind of annoying

    I have a red vertical line on the right side of my screen and it will not go away tried restarting my computer and that didn't help at all, please help me with this problem it is kind of annoying

    If it's a thin 1 pixel wide vertical line it's highly likely it could be caused by a defective LCD.
    One quick basic way to check is to note the position of the line. Then go to System Preferences, Displays, and lower the resolution. If ther line moves it's on the video and the logic board or video card if fitted is likely to be defective. If the line stays in the same position it's likely to be an LCD fault. Either way to have it repaired you'll need to visit an Apple store or AASP.
    The worst offender for this problem is the Late 2006 17" iMac. FOC replacement of the LCD used to be covered by a quality program, but it's now ended.
    Steve

  • Please help me with this "2012 R2" PS Script

    Please be kind to help me with this Script. Thank you.....
    Import-Csv C:\Scripts\NewADUsers.csv | foreach-object { $userprinicpalname = $_.SamAccountName + "@{loona}.com"; New-ADUser -SamAccountName $_.SamAccountName -UserPrincipalName $userprinicpalname -Name $_.name -DisplayName $_.name -GivenName
    $_.cn -SurName $_.sn -Description $_.Description -Department $_.Department -Path $_.path -AccountPassword (ConvertTo-SecureString "Loona123" -AsPlainText -force) -Enable $True -PasswordNeverExpires $Ture -PassThru }
    New-ADUser : Directory object not found
    At line:1 char:114
    + Import-Csv C:\Scripts\NewADUsers.csv | foreach-object { $userprinicpalname = $_. ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (CN=Student01,OU...DC=loona,DC=com:String) [New-ADUser], ADIdentityNotFoundException
        + FullyQualifiedErrorId : ActiveDirectoryCmdlet:Microsoft.ActiveDirectory.Management.ADIdentityNotFoundException,Microsoft.Activ 
       eDirectory.Management.Commands.NewADUser

    Please check it the caractors - + =. i have no idea about PowerShell
    ImportCsv C:\Scripts\NewADUsers.csv |
    ForEach-Object{
    $props=@{
    SamAccountName=$_.SamAccountName
    UserPrincipalName=$_.SamAccountName + '@loona.com'
    Name=$_.name
    DisplayName=$_.name
    GivenName=$_.cn
    SurName=$_.sn
    Description=$_.Description
    Department=$_.Department
    Path=$_.path
    AccountPassword=(ConvertTo-SecureString "Loona123" -AsPlainText -force)
    Enabled=$True
    PasswordNeverExpires=$true
    NewObject @orops -PassThru

  • HT4623 i am having a problem with my iphone 4s. it is not displaying its volume bar in music or anywhere when not connected to earphones. kindly help me with its volume settings.

    i am having a problem with my iphone 4s. it is not displaying its volume bar in music or anywhere when not connected to earphones. kindly help me with its volume settings.

    Have you tried the restart/reset/restore troubleshooting path?  That would be the best initial set of steps to take, particularly in a situation like this.  

  • Help please with this

    Would one of you kind people be able to help me with this. I am almost tearing my hair out.
    This is what i want...
    a small form (table) that states this..
    Description:
    Browse:
    Upload evidence:
    In the description, a small little box so that a user can enter a small note.
    In the browse box, i would like it to go to C:\Program Files\Microsoft Games\Age of Empires II\Screenshots
    and finally, the upload evidence to be uploaded to a part on a ftp server... example /var/www/folder1/folder2
    any help would be amazing!!!!! Thankyou very much

    > even if it is just some kind of HTML code will do.
    Just so i can paste the code in a .txt and save as
    html, and make minor changes to it will do.
    thanks
    If you're looking for someone to write this for you, go here: http://www.rentacoder.com
    If you have a specific, Java-related question about some code you wrote, ask it here.

  • Any one could help me with this soap client program?

    Any one could help me with this soap client program?
    Below is the request format my partner is expecting to see:
    POST /Service.asmx HTTP/1.1
    Host: 192.168.1.1
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    SOAPAction: "https://api.abcdefg.com/GetList"
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
              xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
         <soap:Body>
              <GetList xmlns="https://api.abcdefg.com/">
                   <username>string</username>
                   <password>string</password>
              </GetList>
         </soap:Body>
    </soap:Envelope>The java client I wrote is blow:
    import javax.xml.soap.*;
    import java.util.Iterator;
    import java.net.URL;
    import java.io.*;
    public class Client {
        public static void main(String [] args) {
            try {
                SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
                SOAPConnection connection = soapConnectionFactory.createConnection();
                SOAPFactory soapFactory = SOAPFactory.newInstance();
                MessageFactory factory = MessageFactory.newInstance();
                SOAPMessage message = factory.createMessage();
             // addd SOAPAction;
             MimeHeaders hd = message.getMimeHeaders();
             hd.addHeader("SOAPAction", "https://api.abcdefg.com/GetList");
                // get env and body;
                SOAPPart soapPart = message.getSOAPPart();
                SOAPEnvelope envelope = soapPart.getEnvelope();
             SOAPBody body = envelope.getBody();
                Name bodyName = soapFactory.createName("GetList", "", "https://api.abcdefg.com/");
                SOAPBodyElement bodyElement = body.addBodyElement(bodyName);
                //Constructing the body for the request;
             SOAPElement username = bodyElement.addChildElement("username");
             username.addTextNode("1234567");
             SOAPElement password = bodyElement.addChildElement("password");
             password.addTextNode("7654321");
                System.out.print("\nPrinting the message that is being sent: \n\n");
                message.writeTo(System.out);
                System.out.println("\n\n");
                URL endpoint = new URL ("https://api.abcdefg.com/Service.asmx");
                SOAPMessage response = connection.call(message, endpoint);
                connection.close();
                response.writeTo(System.out);
            }catch (Exception e) {
                 System.err.println("ERROR: ******* " + e.toString());
    }The response my partner's server returned is:
    <faultstring>Server did not recognize the value of HTTP Header SOAPAction:. </faultstring>I used similar code to access the web services provides via tomcat, it works fine...however, for this .NET services it does not work.
    By the way, I also have another version of the clirnt, using JDOM to construct a XML request and wrap with axis message. I got the same error message as above.
    Can anyone point out something for me?
    Any kind of comments will be appreciated!!
    Edited by: Nickolas.Chen on May 6, 2008 7:20 PM

    You will need to Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • I have bought used I phone 4s. I cloud fails to accept my apple ID, which is accepted by I tunes. In fact it says that I have used maximum number of user accounts. Kindly help me in this matter.

    I have bought used I phone 4s. I cloud fails to accept my apple ID, which is accepted by apple store and I tuned.
    It says that I have already used maximum number of user accounts. Kindly help to resolve this problem.

    Hello Renvin29,
    It sounds like you need to disable your iPhone remotely. I'm sorry to hear about your phone! The only way to do this with is Apple services is if you had Find my iPhone enabled. You have 2 options:
    You can use this article to put the phone into Lost Mode and preserve your data on it, but prevent access to it:
    iCloud: Use Lost Mode
    http://support.apple.com/kb/PH2700
    Or you can just erase it remotely outright:
    iCloud: Erase your device
    http://support.apple.com/kb/PH2701
    You should also take a look at this article for additional info on what to do about this situation:
    If your iPhone, iPad, or iPod touch is lost or stolen
    http://support.apple.com/kb/HT5668
    Thank you for using Apple Support Communities.
    Take care,
    Sterling

  • HT5887 Hi,Latest games whichever available in itunes or public domain are not supprting to my IPOD tocuch. Please kindly help me on this

    Hi Everyone,
    I am trying to add games, songs, apps in my IPOD touch but it always saying that it not support. I have downloaded the latest ITUNES then downloaded lot of games,songs. When i try to synchronize all this to my ipod, it is saying that version will support. Please kindly help me on this.
    Thanks,
    Rama Mohan Raju R.

    I suspect you have a 2G iPod. Those can only go to iOS 4.2.1.
    Identifying iPod models
    iPod touch (3rd generation)
    iPod touch (3rd generation) features a 3.5-inch (diagonal) widescreen multi-touch display and 32 GB or 64 GB flash drive. You can browse the web with Safari and watch YouTube videos with Wi-Fi. You can also search, preview, and buy songs from the iTunes Wi-Fi Music Store on iPod touch.
    The iPod touch (3rd generation) can be distinguished from iPod touch (2nd generation) by looking at the back of the device. In the text below the engraving, look for the model number. iPod touch (2nd generation) is model A1288, and iPod touch (3rd generation) is model A1318.
    Many apps not requires a higher iOS version
    To more easily find compatible apps:
    iOSSearch - search the iTunes store for compatible apps.
    Apple Club - filter apps by iOS version.
    Starting when iOS 7 was releases, Apple now allows downloading the last compatible version of some apps (iOS 4.2.1 and later only)
    App Store: Downloading Older Versions of Apps on iOS - Apple Club
    App Store: Install the latest compatible version of an app
    You first have to download the non-compatible version on your computer. Then when you try to purchase the version on your iPod you will be offered a compatible version if one exists.

  • Can someone pls help me with this code

    The method createScreen() creates the first screen wherein the user makes a selection if he wants all the data ,in a range or single data.The problem comes in when the user makes a selection of single.that then displays the singleScreen() method.Then the user has to input a key data like date or invoice no on the basis of which all the information for that set of data is selected.Now if the user inputs a wrong key that does not exist for the first time the program says invalid entry of data,after u click ok on the option pane it prompts him to enter the data again.But since then whenever the user inputs wrong data the program says wrong data but after displaying the singlescreen again does not wait for input from the user it again flashes the option pane with the invalid entry message.and this goes on doubling everytime the user inputs wrong data.the second wrong entry of data flashes the error message twice,the third wrong entry flashes the option pane message 4 times and so on.What actually happens is it does not wait at the singlescreen() for user to input data ,it straight goes into displaying the JOptionPane message for wrong data entry so we have to click the optiion pane twice,four times and so on.
    Can someone pls help me with this!!!!!!!!!
    import java.util.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.text.*;
    import java.util.*;
    public class MainMenu extends JFrame implements ActionListener,ItemListener{
    //class     
         FileReaderDemo1 fd=new FileReaderDemo1();
         FileReaderDemo1 fr;
         Swing1Win sw;
    //primary
         int monthkey=1,counter=0;
         boolean flag=false,splitflag=false;
         String selection,monthselection,dateselection="01",yearselection="00",s,searchcriteria="By Date",datekey,smonthkey,invoiceno;
    //arrays
         String singlesearcharray[];
         String[] monthlist={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"};
         String[] datelist=new String[31];
         String[] yearlist=new String[100];
         String[] searchlist={"By Date","By Invoiceno"};
    //collection
         Hashtable allinvoicesdata=new Hashtable();
         Vector data=new Vector();
         Enumeration keydata;
    //components
         JButton next=new JButton("NEXT>>");
         JComboBox month,date,year,search;
         JLabel bydate,byinvno,trial;
         JTextField yeartext,invtext;
         JPanel panel1,panel2,panel3,panel4;
         JRadioButton single,range,all;
         ButtonGroup group;
         JButton select=new JButton("SELECT");
    //frame and layout declarations
         JFrame jf;
         Container con;
         GridBagLayout gridbag=new GridBagLayout();
         GridBagConstraints gc=new GridBagConstraints();
    //constructor
         MainMenu(){
              jf=new JFrame();
              con=getContentPane();
              con.setLayout(null);
              fr=new FileReaderDemo1();
              createScreen();
              setSize(500,250);
              setLocation(250,250);
              setVisible(true);
    //This is thefirst screen displayed
         public void createScreen(){
              group=new ButtonGroup();
              single=new JRadioButton("SINGLE");
              range=new JRadioButton("RANGE");
              all=new JRadioButton("ALL");
              search=new JComboBox(searchlist);
              group.add(single);
              group.add(range);
              group.add(all);
              single.setBounds(100,50,100,20);
              search.setBounds(200,50,100,20);
              range.setBounds(100,90,100,20);
              all.setBounds(100,130,100,20);
              select.setBounds(200,200,100,20);
              con.add(single);
              con.add(search);
              con.add(range);
              con.add(all);
              con.add(select);
              search.setEnabled(false);
              single.addItemListener(this);
              search.addActionListener(new MyActionListener());     
              range.addItemListener(this);
              all.addItemListener(this);
              select.addActionListener(this);
         public class MyActionListener implements ActionListener{
              public void actionPerformed(ActionEvent a){
                   JComboBox cb=(JComboBox)a.getSource();
                   if(a.getSource().equals(month))
                        monthkey=((cb.getSelectedIndex())+1);
                   if(a.getSource().equals(date)){
                        dateselection=(String)cb.getSelectedItem();
                   if(a.getSource().equals(year))
                        yearselection=(String)cb.getSelectedItem();
                   if(a.getSource().equals(search)){
                        searchcriteria=(String)cb.getSelectedItem();
         public void itemStateChanged(ItemEvent ie){
              if(ie.getItem()==single){
                   selection="single";     
                   search.setEnabled(true);
              else if (ie.getItem()==all){
                   selection="all";
                   search.setEnabled(false);
              else if (ie.getItem()==range){
                   search.setEnabled(false);
         public void actionPerformed(ActionEvent ae){          
              if(ae.getSource().equals(select))
                        if(selection.equals("single")){
                             singleScreen();
                        if(selection.equals("all"))
                             sw=new Swing1Win();
              if(ae.getSource().equals(next)){
                   if(monthkey<9)
                        smonthkey="0"+monthkey;
                   System.out.println(smonthkey+"/"+dateselection+"/"+yearselection+"it prints this");
                   allinvoicesdata=fr.read(searchcriteria);
                   if (searchcriteria.equals("By Date")){
                        System.out.println("it goes in this");
                        singleinvoice(smonthkey+"/"+dateselection+"/"+yearselection);
                   else if (searchcriteria.equals("By Invoiceno")){
                        invoiceno=invtext.getText();
                        singleinvoice(invoiceno);
                   if (flag == false){
                        System.out.println("flag is false");
                        singleScreen();
                   else{
                   System.out.println("its in here");
                   singlesearcharray=new String[data.size()];
                   data.copyInto(singlesearcharray);
                   sw=new Swing1Win(singlesearcharray);
         public void singleinvoice(String searchdata){
              keydata=allinvoicesdata.keys();
              while(keydata.hasMoreElements()){
                        s=(String)keydata.nextElement();
                        if(s.equals(searchdata)){
                             System.out.println(s);
                             flag=true;
                             break;
              if (flag==true){
                   System.out.println("vector found");
                   System.exit(0);
                   data= ((Vector)(allinvoicesdata.get(s)));
              else{
                   JOptionPane.showMessageDialog(jf,"Invalid entry of date : choose again");     
         public void singleScreen(){
              System.out.println("its at the start");
              con.removeAll();
              SwingUtilities.updateComponentTreeUI(con);
              con.setLayout(null);
              counter=0;
              panel2=new JPanel(gridbag);
              bydate=new JLabel("By Date : ");
              byinvno=new JLabel("By Invoice No : ");
              dateComboBox();
              invtext=new JTextField(6);
              gc.gridx=0;
              gc.gridy=0;
              gc.gridwidth=1;
              gridbag.setConstraints(month,gc);
              panel2.add(month);
              gc.gridx=1;
              gc.gridy=0;
              gridbag.setConstraints(date,gc);
              panel2.add(date);
              gc.gridx=2;
              gc.gridy=0;
              gc.gridwidth=1;
              gridbag.setConstraints(year,gc);
              panel2.add(year);
              bydate.setBounds(100,30,60,20);
              con.add(bydate);
              panel2.setBounds(170,30,200,30);
              con.add(panel2);
              byinvno.setBounds(100,70,100,20);
              invtext.setBounds(200,70,50,20);
              con.add(byinvno);
              con.add(invtext);
              next.setBounds(300,200,100,20);
              con.add(next);
              if (searchcriteria.equals("By Invoiceno")){
                   month.setEnabled(false);
                   date.setEnabled(false);
                   year.setEnabled(false);
              else if(searchcriteria.equals("By Date")){
                   byinvno.setEnabled(false);
                   invtext.setEnabled(false);
              monthkey=1;
              dateselection="01";
              yearselection="00";
              month.addActionListener(new MyActionListener());
              date.addActionListener(new MyActionListener());
              year.addActionListener(new MyActionListener());
              next.addActionListener(this);
              invtext.addKeyListener(new KeyAdapter(){
                   public void keyTyped(KeyEvent ke){
                        char c=ke.getKeyChar();
                        if ((c == KeyEvent.VK_BACK_SPACE) ||(c == KeyEvent.VK_DELETE)){
                             System.out.println(counter+"before");
                             counter--;               
                             System.out.println(counter+"after");
                        else
                             counter++;
                        if(counter>6){
                             System.out.println(counter);
                             counter--;
                             ke.consume();
                        else                    
                        if(!((Character.isDigit(c) || (c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)))){
                             getToolkit().beep();
                             counter--;     
                             JOptionPane.showMessageDialog(null,"please enter numerical value");
                             ke.consume();
              System.out.println("its at the end");
         public void dateComboBox(){          
              for (int counter=0,day=01;day<=31;counter++,day++)
                   if(day<=9)
                        datelist[counter]="0"+String.valueOf(day);
                   else
                        datelist[counter]=String.valueOf(day);
              for(int counter=0,yr=00;yr<=99;yr++,counter++)
                   if(yr<=9)
                        yearlist[counter]="0"+String.valueOf(yr);
                   else
                        yearlist[counter]=String.valueOf(yr);
              month=new JComboBox(monthlist);
              date=new JComboBox(datelist);
              year=new JComboBox(yearlist);
         public static void main(String[] args){
              MainMenu mm=new MainMenu();
         public class WindowHandler extends WindowAdapter{
              public void windowClosing(WindowEvent we){
                   jf.dispose();
                   System.exit(0);
    }     

    Hi,
    I had a similar problem with a message dialog. Don't know if it is a bug, I was in a hurry and had no time to search the bug database... I found a solution by using keyPressed() and keyReleased() instead of keyTyped():
       private boolean pressed = false;
       public void keyPressed(KeyEvent e) {
          pressed = true;
       public void keyReleased(KeyEvent e) {
          if (!pressed) {
             e.consume();
             return;
          // Here you can test whatever key you want
       //...I don't know if it will help you, but it worked for me.
    Regards.

Maybe you are looking for