Help me with ordsys.ordimage

i have problems when using interMedia to import images on DB server.
i have 2 tables :
create table t( pic_id number, pic_ord ordsys.ordimage);
create table demo(id number, b BLOB);
create directory PICDIR as 'd:\pic'; --- this directory is correct on server;
grant read on directory PICDIR to PUBLIC;
commit;
DECLARE
img ordsys.ordimage;
ctx raw(4000);
BEGIN
insert into t values(1,ordsys.ordimage.init());
select pic_ord into img
from t
where pic_id=1 for update;
img.setSource('FILE','PICDIR','1.bmp');
-- set source is OK,but the following IMPORT() raises exceptions
img.import(ctx);
img.setProperties();
update t
set pic_ord=img
where pic_id=1;
commit;
end;
ERROR at line 1:
ORA-29400: data plug-in error IMG-00002:
ORA-06512: at "ORDSYS.ORDIMG_PKG", line 590
ORA-06512: at "ORDSYS.ORDIMAGE", line 65
ORA-06512: at "ORDSYS.ORDIMG_PKG", line 677
ORA-06512: at "ORDSYS.ORDIMAGE", line 213
ORA-06512: at line 16
=====================================
after millions of times trying that ,i tried to load the file into a blob,
and copy from blob to ordsys.ordimage.source.localdata(this is a blob);
see:
DECLARE
l_blob blob;
l_file bfile;
BEGIN
delete from t;
insert into demo values(1,EMPTY_BLOB())
returning b into l_blob;
l_bfile := bfilename( 'PICDIR', '1.bmp');
dbms_lob.fileopen( l_bfile );
dbms_lob.loadfromfile( l_blob, l_bfile, dbms_lob.getlength( l_bfile ) );
dbms_lob.fileclose( l_bfile );
end;
succeed!
SQL> select id, dbms_lob.getLength(b) from demo;
ID DBMS_LOB.GETLENGTH(B)
1 1963494
===================================================
then i copy the blob into t.pic:
insert into t
( select id, ordsys.ordimage(ordsys.ordsource(b,NULL, NULL, NULL, SYSDATE, 1 ),
NULL, NULL, NULL, NULL, NULL, NULL, NULL )
from demo
==================================================
then i check the blob's size in ordimage,and use setProperties() :
declare
img     ordsys.ordimage;
ctx     raw(4000);
begin
select pic into img
from t
where pic_id= 1 for update;
dbms_output.put_line('ord blob length:'||dbms_lob.getLength(img.source.localdata));
img.setProperties();
update t
set pic=img
where pic_id=1;
commit;
end;
ord blob length:1963494
declare
ERROR at line 1:
ORA-29400: data plug-in error:IMG-00002:
ORA-06512: at "ORDSYS.ORDIMG_PKG", line 590
ORA-06512: at "ORDSYS.ORDIMAGE", line 65
ORA-06512: at line 10
i do not know the mechanism of data plug-in. but i suppose it's the configuration's error of my oracle DB.
please help me!!
[email protected]

Thank you!
My db version is 9.0.1.0.1
interMedia version 9.0.1.0.1
i thought it's the installation error, but i have tried the /ord/im/admin/imchk.sql.
Both version and components are VALID.
JServer setup is correct.
the JServer java objects are all valid.
ORDSYS.ORDPLUGINS is VALID.
but the codes can still not run!!
i don't know what's wrong.
please help me!
thank you!!
Apex

Similar Messages

  • How to populate a table with ORDSYS.ORDImage item by BLOB item?

    Hi, I have a table, that contain blob column and another table with ORDSYS.ORDImage column and I would like to populate ORDSYS.ORDImage item in table by BLOB item, in which I have store some images?

    You should be able to do something like (this is off the top of my head, so please excuse any compile errors...):
    define
    b blob;
    i ordsys.ordimage;
    begin
    INSERT INTO ordsysImgs VALUES (1,ORDSYS.ORDImage.init());
    select imgCol into i from ordsysImgs where ID = 1 for update;
    select blobcol into b from blobImgTable;
    i.source.localdata := b;
    i.setlocal();
    i.setproperties();
    update imgcol set imgCol = i where ID = 1;
    commit;
    end;

  • Limitations with interMedia with ORDSYS.ORDImage.process()?

    Hello,
    We are currently writing an Apex application that will allow our users to upload pictures to the database. We have been using interMedia to manipulate them as we want to create thumbnails etc. We have one picture that just won't scale down at all. We are using blobs to store the images on the database. We are using the command:
    ORDSYS.ORDImage.process(l_thumb, 'maxscale=160 160');
    and as I say most of the images are scaling but some are not. The image details is by using ORDSYS.ORDImage.getProperties:
    MIME Type: image/jpeg
    Width: 3292
    Height: 3279
    File Format: JFIF
    Content Format: 24BITRGB
    Compression Format: JPEG
    Content Length/Size: 3634347 (bytes)
    As I say when I try and do the process command it makes no difference as the thumbnail properties are the same as the original properties.
    If so is there anyway around this?
    Thanks,
    Paul.

    Hi there.
    We are trying to do this in PL/SQL and was wondering if it did write anything to a exception table?
    Here is the code that we use:
    declare
    l_page blob;
    l_web blob;
    l_thumb blob;
    L_TEMP_BLOB BLOB;
    TEMP_ID INTEGER;
    AMOUNT INTEGER;
    l_mime VARCHAR2(250);
    begin
    IF (:P2_FILE_NAME is not null)
    THEN
    SELECT blob_content a, mime_type
    INTO L_TEMP_BLOB, l_mime
    FROM HTMLDB_APPLICATION_FILES
    WHERE NAME = :P2_FILE_NAME;
    INSERT INTO PL_IMG_DATA(img_data_id, title, location, img_date, grid_ref, orig_img_loc, description, staff_number,unit_id, mime_type, file_name)
    VALUES (PL_IMG_DATA_SEQ.nextval, :P2_TITLE, :P2_LOCATION, :P2_DATE, upper(:P2_GRID_REF), :P2_ORIGINAL_LOCATION, :P2_DESCRIPTION, :P2_STAFF_NUMBER, :P2_MAN_UNIT, l_mime, :P2_FILE_NAME)
    RETURN img_data_id into TEMP_ID;
    COMMIT;
    UPDATE PL_IMG_DATA SET THUMBNAIL = EMPTY_BLOB(), WEB_IMG = EMPTY_BLOB(), PAGE_IMG = EMPTY_BLOB()
    WHERE IMG_DATA_ID = TEMP_ID;
    COMMIT;
    SELECT THUMBNAIL, WEB_IMG, PAGE_IMG
    INTO l_thumb, l_web, l_page
    FROM PL_IMG_DATA
    WHERE IMG_DATA_ID = TEMP_ID
    FOR UPDATE;
    amount := dbms_lob.getlength(L_TEMP_BLOB);
    DBMS_LOB.copy(l_thumb, L_TEMP_BLOB, AMOUNT, 1, 1);
    DBMS_LOB.copy(l_WEB, L_TEMP_BLOB, AMOUNT, 1, 1);
    DBMS_LOB.copy(l_PAGE, L_TEMP_BLOB, AMOUNT, 1, 1);
    ORDSYS.ORDImage.process(l_thumb, 'maxscale=160 160');
    ORDSYS.ORDImage.process(l_web, 'maxscale=320 320');
    ORDSYS.ORDImage.process(l_page, 'maxscale=640 640');
    UPDATE PL_IMG_DATA SET THUMBNAIL =L_THUMB, WEB_IMG = L_WEB, PAGE_IMG = L_PAGE
    WHERE IMG_DATA_ID = TEMP_ID;
    COMMIT;
    DELETE FROM HTMLDB_APPLICATION_FILES
    WHERE NAME = :P2_FILE_NAME;
    END IF;
    END;
    As we say it seem to work for images that are a certain size but anything that is roughly over 3,500 KB it doesn't scale it down.
    We were wondering if the this is a version problem as we are currently on Oracle 9.2.0.8.0?
    We did manage to scale it down when we used a TIFF but then the application didn't display it so we converted the scaled down image back to a jpeg. This seems a bit mad to do right enough,

  • Cann't export ORDImage object with ORDSYS.ORDSOURCEExceptions

    I have a table used ORDSYS.ORDIMAGE object. Now, i want to export images to file system with PLSQL.
    PROCEDURE exp_img(pid IN VARCHAR2) IS
    local_image ORDSYS.ORDIMAGE;
    filename VARCHAR2(10);
    img_location varchar2(200) := '.../living/images/';
    ctx RAW(32767) := NULL;
    BEGIN
    SELECT NEWSPICT
    INTO local_image
    FROM INFO_DIRECT_IMG
    WHERE NUMID = pid;
    filename := 'smict.jpg';
    if (local_image.isLocal) then
    local_image.export(ctx, 'FILE', img_location, filename);
    end if;
    END exp_img;
    The intermedia version is 9.2.0.1.0, and I have granted the permissions to the ORDSYS and ORDPLUGIN. But when i execute the procedure, I caught the ORDSYS.ORDSOURCEExceptions.SOURCE_PLUGIN_EXCEPTION exception.
    why?
    and how can I fix it?
    Thanks!

    img_location should be the name of a directory object in Oracle. Read the documentation again. You should see the following commands.
    connect sys/<password> as sysdba
    create or replace directory my_location as '/some/directory/path';
    now the call to export would look like
    img.export(ctx, 'FILE', 'MY_LOCATION', 'foo.jpg');
    note that MY_LOCATION is uppercase. This is because database object names (like the directory name we created) are automatically upcased in the default.
    you can also use your variable like so:
    img_location varchar2(200) := 'MY_LOCATION';
    note that it references the name of the directory.
    then
    img.export(ctx, 'FILE', img_location, 'foo.jpg');

  • Diplaying of ordsys.ordimage field in a Report based on Query

    Hi,
    I have a table with a ordsys.ordimage field, where I am uploading images. I created a custom report based on that table but I just cant seem to find a way to show images in it. Could anyone please tell me how to do this.
    I tried using this
    "portal30.wwv_user_utilities.get_intermedia('CP_IMAGE01','CP_IMAGE01','IMAGE',rowid) the_picture " but this does not help at all
    Thanks!
    vimpi

    Hello Prajwal,
    It is definely possible !!
    If you have already created your query pls paste the same here so that I can help you otherwise. I will give you a general guidelines and you can take it from there..
    Using the CASE Statement inside your SELECT you can achieve this.
    SELECT T1.ItemCode AS 'Item No.', T1.ItemName AS 'Item Description',
    CASE WHEN  T1.QryGroup1 = 'N' THEN T0.Price ELSE 0 END 'List Price'
    FROM  [dbo].[ITM1] T0  INNER  JOIN [dbo].[OITM] T1  ON  T1.ItemCode = T0.ItemCode   WHERE T0.PriceList = 1

  • ORDSYS.ORDIMAGE vs BLOB

    Dear all,
    I've designed a table with an ordsys.ordimage field for images. BIG MISTAKE, because there is no possibility to upload images from a form. I'd like to change it into a BLOB field but an error arises:
    "You cannot modify the column definition for types CLOB, NCLOB, BFILE, BLOBand Intermedia Object types(ORDSYS.ORDIMAGE, ORDSYS.ORDAUDIO, ORDSYS.ORDVIDEO). (WWV-17079)"
    Could I change it anyhow in order not to build a new table? I have a lot of forms referring to that table and I should change these forms too....(and we know it is pretty difficult)...
    I would appreciate any help.
    Tomas

    And you are possible to display blob from table in form s image item?
    I tried this, but it didn't go, can you tell me, how did you do?

  • ORDSYS.ORDimage and BLOB convertion

    Hi every one,
    I have a ORDSYS.ORDimage in a table (under Oracle 9i) that I need to show in a Forms 6i Image item (wich is finally a BLOB I guess).
    Is there anyone that could tell me how to convert ORDSYS.ORDimage into a BLOB. I found in the interMedia documentation examples on how to save a BLOB into a ORDSYS.ORDimage with the filename of the image but I found nothing on converting ORDSYS.ORDimage into BLOB and vice versa.
    Thank everyone for your help.
    Marc

    And you are possible to display blob from table in form s image item?
    I tried this, but it didn't go, can you tell me, how did you do?

  • ORDSYS.ORDImage.processCopy

    Hello,
    i have problem - when i create thumbnail from bigger picture (biger as 5 Mpixel) then application create record with length "0" (blob)
    ORDSYS.ORDImage.processCopy(src_blob,'maxscale=180 130', dst_blob);
    update iacs_lob.lo_thumb set thumb_data=dst_blob where id =iid;
    end;
    can you help me? thanks

    Just to update it seems that the problem is that colour range is not being normalized properly. For example, if use the linux command
    convert -normalize input.tif output.jpg
    This will produce a decent looking image. Are there any auto normaliztion function in the process() function?

  • How to build a report on a table containing ORDSYS.ORDIMAGE type?

    Hi
    I build a table with a column of type ORDSYS.ORDIMAGE then I
    build a form using wizard and populate the table by uploading
    intermedia type and I can make query on that form and see the
    image. But when I build a report using wizard, the report result
    shows image data as it is in text format.
    Am I doing something wrong or there is another way to make
    report on ORDSYS.ORDIMAGE column type.
    Thanks.
    bye

    This could be because, you might have the display type as text
    instead of html for this column.
    Could you pls verify this by selecting as html and try running
    the report. If it still not working then pls post your Portal
    Version so that we can verify it out here. Presently, it is
    working fine for me.
    Thanx,
    chetan.

  • OrdSys.OrdImage

    Hi Guys
    Have a bit of a problem here
    I have a ordsys.ordimage columns in my DB
    i use a adf:render on the column
    to display it on the jsp
    now the problem is i have there images that will display on the jsp ... it displays the images but what it does is display the first pic three times.....
    here is a section from the view source on the page
    <IMG SRC="ordDeliverMedia?appModID=FeatPropModuleDataControl&viewObjectName=FeatPropModule.FeatEstView&contentCol=FeaturePic&rowKey=000000000001000000FED41C6F1E&cache=1094297776000" ALT="FeaturePic" HEIGHT="166" WIDTH="250">
    <IMG SRC="ordDeliverMedia?appModID=FeatPropModuleDataControl&viewObjectName=FeatPropModule.FeatEstView&contentCol=FeaturePic&rowKey=000000000002000000FED41C6F1E&cache=1094479865000" ALT="FeaturePic" HEIGHT="166" WIDTH="250">
    <IMG SRC="ordDeliverMedia?appModID=FeatPropModuleDataControl&viewObjectName=FeatPropModule.FeatEstView&contentCol=FeaturePic&rowKey=000000000003000000FED41C6F1E&cache=1094479936000" ALT="FeaturePic" HEIGHT="166" WIDTH="242">
    So i does get the diff RowKeyStr
    here is the JSP before display
    <c:forEach var="Row" items="${bindings.FeatEstView.rangeSet}">
    <tr>
    <td> 
    </td>
    <td>
    <c:out value="${Row['EstId']}"/> 
    </td>
    <td>
    <c:out value="${Row['PropCode']}"/> 
    </td>
    <td>
    <adf:render model="Row.FeaturePic" />
    </td>
    </tr>
    </c:forEach>
    Please if anyone can help me.
    Thanks

    I cobbled together a little app that lets me upload a
    text file and an image icon to a single database
    table. I posted the (not commented, but no custom
    code was required to build it!) quick-and-dirty
    sample here:
    http://otn.oracle.com/products/jdev/tips/muench/upload
    text/UploadTextFile.zipHi,
    Any example on how to use this stuff in one ADF Rich Faces .jspx page ?
    I do not want to write my own "image-serving-servlet" in order to show image in the af:image - OrdImageDomain is exactly what I need, but don't know how to use this in one ADF Faces page...

  • Selecting from ORDSYS.ORDImage field

    I have a table which contains a photo field of type ORDSYS.ORDImage. I can select images from that table to a report from query wizard, because there in display option you can check "Embed interMedia rich content in the report" -option. That option does not exist in reports from SQL query. So how can I select these images to a normal SQL report?? Is it even possible?
    null

    Does somebody have any ideas how to do this?
    I also tried to show ORDIMAGE in SQL query based report but with no success.
    Thanks in advance!

  • Problem with reading ORDImage from DB

    I have table imgtable with
         id number
         Image ordsys.ordImage
    columns and for query
    declare
    src BLOB;
    BEGIN
    Select t.image.getcontent into src from imgtable t where t.id = 1;
    END;
    I receive following erros:
    Select t.image.getcontent into src from imgtable t where t.id = 1;
    ERROR at line 4:
    ORA-06550: line 4, column 12:
    PL/SQL: ORA-00904: "T"."IMAGE"."GETCONTENT": invalid identifier
    ORA-06550: line 4, column 4:
    PL/SQL: SQL Statement ignored
    What is my problem?
    I have Oracle interMedia 9.2.0.1.0 on Linux system, and I veryfied; ORDSYS.ORDImage have getcontent function that return BLOB.

    You should be using t.image.getcontent().....
    declare
    src BLOB;
    BEGIN
    Select t.image.getcontent() into src from imgtable t where t.id = 1;
    END;
    Or better yet (since you can access metadata, like mimetype this way):
    declare
    img ordsys.ordimage;
    src BLOB;
    begin
    select t.image into img from imgtable t where t.id = 1;
    src := img.getContent();
    end;

  • Search for a color in ordsys.ordimage

    Hi,
    Is it posible to make a search for a specific color in a column ordsys.ordimage. For example i ask i want all the pictures that contains RGB(255,0,0),
    Thanks.

    Hi,
    This is one of the features we are considering for the next release.
    Would you be able to share with us the specifics of the application -
    the domain, what kind queries does the application have ? Do you only look for
    colors or do you also look for specific shapes? Any information will be
    really useful to us in preparing the functionality for this feature.
    Also we would like to get a feeling for the range of applications that
    would find this feature useful.
    I look forward to hearing from you.
    Melli

  • Could someone help me with a Runtime Error while saving a PDF file?

    While saving a 28 page PDF file in Illustrator today, I got a window saying, "This application has requested the "Runtime" to terminate it in a unusual way." It said to contact the applications support team for more information. I keep getting the same thing each time I try it. Does anyone know how to fix this issue or how I contact the applications support team ?
    Thank you for any insight.
    Pam

    It is a 13.5x11 inch calendar. There are 14 pages with images on them and
    some text. The other pages have text, a grid and a colored background with a
    gaussian blur. I saved each page as an "outline".
    The printer I am using requested I save all pages in a pdf file. I was
    successful in saving all but about six pages, now I can't even open the
    file.
    What happens is... I open Illustrator
                                   I open the pdf file
                                   A window appears that says... Runtime Error,
    This application has requested the Runtime to terminate it in an unusual
    way. Please contact the application's support team for more information.
                                   I select ok
                                   then a window appears that says... Adobe
    Illustrator CS5 has stopped working. A problem caused the program to stop
    working correctly. Windows will close the program and notify you if a
    solution is available.
                                   Then the program closes.
    So far I have not been notified of anything.
    Please let me know if you need more details.
    Thank you so much for helping me with this.
    Pam

  • 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