JTextField document model

Hi,
I have a JTextField field, which is supposed to be read only field to show time.
My application gets from server a long value, which represents the time.
This JTextField field shows the time (from server) in format mm:hh:ss (need to convert the long value to the format).
My question is:
Which document model should I use and how? I don't find a good example for that.
Thanks

I have a JTextField field, which is supposed to be read only field to show time.I would say that typically you would use a JLabel for this. Then you just use the setText() method.

Similar Messages

  • Detecting key events and setting caret position from a Document model

    Hello, I have created a "masked" JTextField that contains specific formatting (these subclasses were created prior to the advent of Sun's implementation of masked fields, and are used extensively throughout my system, so I can't easily implement Sun's version at this time)
    At any rate, here is the problem:
    Consider the following "masked" field contents (date USA format):
    The user keyboard input is:
    "10252002", which results in the text field display of "10/25/2002"
    The user presses the "delete" key in the first position of the masked field. The following result is "0/25/2002".
    This is undesirable, since all the contents of the field have shifted to the left by one position, so the first "/" is now in position 2, instead of position 3. Also, the length of the field is now 9, instead of 10.
    The field should really have the following contents: "02/52/002_", and the cursor should remain on the first position of the text field.
    I believe need for the Document model to be able to differentiate between a "back space", and a "delete", so that my overridden "remove" method in my PlainDocument subclass can handle
    insertion/repositioning of "masked literal" characters correctly, and also control the cursor movement accordingly.
    What would be the best way to handle this?

    I would re-post to the Flex Data Services forum.

  • JTextFields and model:Can i create a text model like ListModel for Lists

    Hi,
    i'm doing a cache simulator which uses several JTextFields to show information.
    The problem is this:i have a class named cache which implements the observable interface and i use various variables to update the JtextFields everytime one of these changes.
    So,everytime a values changes i'm doing this ugly thing...
    accessResult="0";
    setChanged();
    notifyObservers(accessResult);and in the applet class i receive it:
    public void update(Observable o, Object arg) {
    if (o.equals(this.machine.cache)) {
    if (arg.equals(this.machine.cache.accessResult)) {
                            if (this.machine.cache.accessResult == "0") {
                                this.resultTextField.setForeground(Color.red);
                                this.resultTextField.setText("MISS");
    else if...//other variable
    //other variable
    }Anyway maybe i need to implement a model for each of the 10 JtextFields
    so that they update automatically.
    I dont know if this is feasible but i imagine i can do it just like i set up a model for a JList.
    I think that the best way is to create the models and then call once the notifyObservers() which should only do a repaint.
    Am i correct?
    I think i'm missing something(maybe many things) about the correct use of the Observer-Observable (i've seen some tutorials)
    but i need to know if i can render my work more elegant but not rewriting all code.
    Thank you very much.
    Chris

    i use the JtextFields for output.
    Sorry i'm new to java and even if i program intensively for the last 8 months
    some things are not so clear to me..
    Ok i know that exists the default model which i can get like this:
    pcTextField.getDocument();should i register the document listener with the JtextField?
    Please If you can, give me a very simple example(i dont want to waste your time) .
    I initially thought that i have to create a proper class which implements necessary methods for
    auto-update like this one i did for a JList:
    class RegList implements ListModel {
            public void addListDataListener(ListDataListener l) {}
            public Object getElementAt(int i) {
                String rval = "";
                if (i < 16) {
                    int regNum = i * 2;
                    for (int j = 0; j < 2; j++) {
                        int theReg = regNum + j;
                        rval = rval + names[theReg] + " = " +
                               (regs[theReg]) + " ";
                    return rval;
                } else {
                    return rval;
            public int getSize() {
                return 32;
            public void removeListDataListener(ListDataListener l) {}
        public ListModel getRegListModel() {
            return new RegList();
    }Thank you very much,
    while waiting for your answer i go give a look at documentListeners.
    Chris

  • JTextField(Document, string, int)

    Dear friends,
    Could you just tell me how can I fix the size of the JTextField,
    such as just accept the maximum number of digits or characters in JTextField...
    I cant create the Document....
    Could anyone give me a tips?

    I found the best way to do this is to subclass PlainDocument as follows:
    public class MyTextDoc extends PlainDocument
        int maxCharacters;
        public MyTextDoc(int maxChars) {
            maxCharacters = maxChars;
        public void insertString( int offs, String str,  AttributeSet a )
                    throws BadLocationException {
            if( (getLength() + str.length()) <= maxCharacters)
                super.insertString(offs, str, a);
            else
                Toolkit.getDefaultToolkit().beep();
    }I then use this document in the constructor for all my JTextFields.
    I'm not sure what you mean by "I cant create the Document...."
    Cheers
    Gary

  • JTextField & Document Event

    Hi I need to create a GUI like a calculator with number buttons. When I press 2 if this is the first character on the text field, I should set tp "B " [B and space]. I saw many examples of DocumentFilter and Document Event using to modify the data or generate events when pressing the keys. Then I need to add special characters after few more numbers are eneterd, eg for an input is "B 34.5567" using only keys 0-9.
    Another example was to use JFormattedTextField, I posted another question on the this and got some help to use DocumentFileter.
    I am facing a problem here on how to bind the keys from the GUI to these document events. When I press the keys, I can see events are fired, but cant use it to modify the JFormattedTextField. How should I do this? I am new to JAVA Swing. I am using the examples from the net to get this done.
    Thanks for help in any advance.

    user4071312 wrote:
    Another example was to use JFormattedTextField, I posted another question on the this and got some help to use DocumentFileter.
    what did you try so far? What happened when you used the suggestions in the other thread? Show us that you are trying, that infamous small runnable ... <g>
    BTW, personally, I think it rather impolite to ask a question, get some suggestions and then simply start over again in a new thread.
    I am facing a problem here on how to bind the keys from the GUI to these document events. please get your technical vocabulary right: in the context of Swing "bind keys" is a standing term. It's unrelated to document events.
    When I press the keys, I can see events are fired, but cant use it to modify the JFormattedTextField. assuming with "events" you mean the documentEvents in a DocumentListener: you don't modify the view, you modify the model (and preferably in a DocumentFilter, as you were already advised)
    How should I do this? I am new to JAVA Swing. Boils down to a very general question: How to learn :-) First you have to learn the basics. Start simple, read tutorials, read code, try to modify what you see, experience how it works (and fails <g>)
    I am using the examples from the net to get this done. not enough - you have to understand them. Now go ahead, choose a simple starter (like the one in snoracles online tutorial) and tweak until it works like you want
    Cheers
    Jeanette

  • Can someone explain the new "Document Model" for open/save?

    Upgraded directly from OSX Snow Leopard Server to OSX Mountain Lion Server.
    Obviously, there are quite a few changes in how the new OS deals with file management.
    NOTE: For users with the non-Server version of Mountain Lion, when you enable RAID (Mirror) on your drives, you cannot create a Recovery Partition. So, no Time Machine backups, and "Revert To" has nothing to revert to. Nor does automatic backups work.
    So, what should be my process for managing files? Specifically, what is my recommended workflow in place of "Save" and "Save As" so that I do not rewrite over existing files and can save copies with a revised file name to the same or a different directory?

    If you Duplicate, then Save… asks for file name. ..."
    An extra-step workflow that mimics the old "Save As" command. I think I understand this.
    If you just Save a document you are working on, it saves just as it always did. However, if Versions is supported, Save forces a new version as opposed to the normal version interval. ..."
    This is what worries me with users. This will re-write the original file with changes incorporated, yet OSX users (who have adopted the new Mountain Lion workflow on standard OS machines) may be under the impression that an older version could be recovered, which it cannot.
    I need to have a clear understanding of what to explain to users to avoid issues with files "disappearing" when they believe they were protected by Versioning.

  • JTextField Document validation

    What is the best way to use Document to validate a textfield that will only accepts numbers between 1 and 30.

    Lets say there is a situation where we really need to prevent users from typing numbers out of range (instead of showing an error message afterwards). I looked at the tutorial and there is an example on how to use DocumentFilter to restrict input to Integers. I tried to adapt it to do range checking. I was successful in enforcing max value but I can't get it to enforce min value. If the min value is 2 and if the user types 11 then DocumentFilter.insertString is called twice. First with just 1 and then with 11. Is there someway to stop insertString from being called until the user is done typing? I must be missing something obious.

  • Create content modell, logical/physical document class, TA CT04/cl02/dc10

    Dear experts,
    Im about to get to know the SAP DMS. Content Server is already running working as well as the content repositories. I now wanna set up a content modell for testing with knowledge provider.
    Im a bit confused about the different ways of doing that. What is actually the difference between creating a CHAR in TA ct04, creating a class in Cl02 with type 017 and the alternative of creating a content model with TA SRMCMCREATE or directly in the document modelling workbench.
    Once ive hopefully understood the difference how can i start actually creating / uploading real (physical documents) cause in dont understand what TAs cvn01n/02n/03n are for.
    There is a large number of function modules for kpro. Fo example when testing SDOK_LOIOS_CREATE i have to enter an RFC destination. What do i have to type in as RFC destination intending to store in content repositories of content server?
    I know thats more than one question at a time but i would be very pleased some of these get answered.
    Thanks a lot in advance.

    Dear Christian,
    I would like to start providing you information with CT04 question. Here the CHAR value is used for maintaining the type of classification characteristics. The CHAR entry stands for 'Character' type which
    means you can add alphabetical and numerical values to this classification characteristic. Transaction CT04 is normally used for creating classification characteristics. In CL02 you can create a class for
    classification and then add the characteristics to it. In the standard class type 017 is used for classifying document info records.
    Transaction CV01N/CV02N/CV03N are used in standard for document managment functionalities. Here you can create/edit/display your document info records. These document info records are like a frame for your original files which could be added to an info record and then checked into your Content Server.
    During this check in function the KPRO function modules are used too.
    For further information I would recommend you to see the SAP online documentation under http://help.sap.com.
    Best regards,
    Christoph

  • JTextField keyEvent consume()

    This question is related to the keyEvent-architecture.
    The JTextField (or any JTextComponent for that matter) is designed to use the keyEvents but NOT consume it. Which means the JTextField modifies its internal Document-model and leaves the keyEvent to propagate further for any body (parent-component etc.) to use it.
    I dont really understand why the design leaves that event to be used by anybody with key-mapping for that keyEvent !?!
    In the specific problem that I have, I am putting JTextField in MainFrame which also has zoomIn/zoomOut Menu-actions attached to Minus(-) and Plus(+) keys respectively.
    What I notice is whenever I type, Minus(-) in JTextField, zoomIn is invoked !!
    Well, I was able to prevent that from happening by attaching a keyListener to my JTextField whose ONLY JOB is to consume() ALL keyevents. (ConsumeAllKeysListener)
    This preety much solves my problem. But I would like to know, is this the correct way to prevent STRAY keyEvent propagation ?
    Also until now, I thought that the JTextField uses InputMap/ActionMap to append all the regular keys that are typed. This assumption is does not seem to be true since even when I consume all the keyEvents by attaching the "ConsumeAllKeysListener" the keys actually end up being typed in the JTextField (although that is what I want).
    But, this behaviour makes me think that JTextField has its Document/model setup as keyListener to itself rather that handling the keyEvent using InputMap/ActionMap. Is this true ?
    Hope I am not confusing the matter !?!
    Thanks in anticipation,
    -sharad

    As mentioned above the correct way to do this is to use a Document to edit any characters as they are typed. The reason for this is that this approach will work whether data is 'typed' or 'pasted' into the text field. Check out this section from the Swing tutorial for more information on Documents and examples:
    http://java.sun.com/docs/books/tutorial/uiswing/components/textfield.html#validation
    I do not recommend using a KeyListener, but here is the reason why it doesn't work.
    Three events are generated every time you type a character into a text field:
    1) key pressed
    2) key typed
    3) key released
    The key typed event seems to be the important event for adding text to the text field so you could add code in the keyTyped(..) method:
    if (e.getKeyChar() == ',')
        e.consume();

  • Wrapper around JTextField

    Hi,
    I am writing a wrapper around the class JTextField for some added functionality. The added functionality includes filtering out alphabetic and special characters and that too of fixed length. Please tell me how do I go about this?
    Arvind

    you should subclass JTextField and Document Model.
    take a look at:
    public class UpperCaseField extends JTextField {
    public UpperCaseField(int cols) {
    super(cols);
    protected Document createDefaultModel() {
               return new UpperCaseDocument();
    static class UpperCaseDocument extends
    tends PlainDocument {
    public void insertString(int offs, String
    s, String str, AttributeSet a)
                   throws BadLocationException {
                   if (str == null) {
                    return;
                   char[] upper = str.toCharArray();
                   for (int i = 0; i < upper.length; i++) {
                    upper[i] = Character.toUpperCase(upper);
    super.insertString(offs, new
    ng(offs, new String(upper), a);
    Yeah! But would it be okay to overide the propertychange method of JTextField class so that I can filter the key code so that if I i type in characters more than the specifield lenght or characters that need to filtered out to be consumed? Please help me on this!

  • Fully expanded tree using tree model

    Hi every body,
    I have represented into jtree form after reading xml document using the tree model. But I want to displayed
    the fully expanded tree at the screen when program run.
    Please help me.
    Thanks
    Edited by: ahmadgee on Jul 11, 2008 3:42 AM

    Thanks for your help
    For get the the tree in expanded form, I am using the expandAPath funtion by the following way.
    public class XMLTreePanel extends JPanel {
           private JTree tree;
           private XMLTreeModel model;
           public XMLTreePanel() {
                    setLayout(new BorderLayout());
            model = new XMLTreeModel();
         tree = new JTree();
         tree.setModel(model);
         tree.setShowsRootHandles(true);
         tree.setEditable(false);
         expandAPath(tree);
         JScrollPane pane = new JScrollPane(tree);
         pane.setPreferredSize(new Dimension(300,400));
         add(pane, "Center");
         final JTextField text = new JTextField();
                    text.setEditable(false);
         add(text, "South");
         tree.addTreeSelectionListener(new TreeSelectionListener() {
              public void valueChanged(TreeSelectionEvent e) {
              Object lpc = e.getPath().getLastPathComponent();
              if (lpc instanceof XMLTreeNode) {
                   text.setText( ((XMLTreeNode)lpc).getText() );
    public void expandAPath(JTree tree){               
         for(int i=1; i<tree.getRowCount(); ++i) {
              tree.expandRow(i);            
    public void setDocument(Document document) {
         model.setDocument(document);
    public Document getDocument() {
         return model.getDocument();
    }

  • BPS Documents not storing/saving in Production

    We are using the Document functionality in BPS layouts to create and store a Microsoft Word document associated with a particular cell.  We have set all the necessary characteristics' document attribute properties, and these have been generated in each of our systems, Development, QA, and Production.
    This functionality is working perfectly in our Development and QA environments.  However, in Production, the user creates a document, he/she can see the document icon in the Excel-in-Place layout, and saves.  When the user comes back into the layout, the icon is missing.  The document cannot be seen in the Administrator's Workbench->Documents central administration.  In QA and in Development, the documents successfully save, and can be viewed in the Admin. Workbench->Documents.
    As far as I can tell, all configuration is the same in all three environments.  I've checked the bds service in SICF and it's active across the board.  I've checked all that I can in the Document Modelling Workbench, and everything is identical.  I even see the table these are stored in (BDSPHIO10), but it's empty in Production, filled with values in QA and Dev.
    What am I missing?  Why is this not working in Production?
    Thanks for any help you can offer.
    - John Gooch
    214-978-6549
    Hunt Consolidated, Inc.
    Dallas, TX

    Thank you for your suggestion, Marc.  I placed the breakpoint as described and then tried to execute the planning folder as before and store a document.  When I clicked 'Save', I reached the breakpoint and began stepping through the code.  When it called the function module 'SKWF_LOIO_WITH_PHIO_CREATE', the LS_ERROR came back with:
    ID =   SKWF_SDOKKERRS
    Type = E
    No =   030
    V1 =   BW_LO_TRAN
    I checked the description of the error message in T100, and it looks like the error is:
    "Characteristic of class 'BW_LO_TRAN' is not valid."
    When it calls function module 'SKWF_PHIO_STORE_CONTENT' next, the error is E001 in the same class:  "'&1' does not exist."  I'm assuming this is due to the failure of the previous function module call.
    Any idea how I can make the "characteristic of class 'BW_LO_TRAN'" valid?
    Thanks again, this gives me more information about the potential problem.
    - John

  • How do I set document resolution

    I'm trying to create a pages document that can be exported as a pdf, then converted to an ebook for uploading to an iPad. I've set the document size to 5"x7.5" (2x3 ratio) but can't find a method to set the document resoluton to 120 dpi. When I create the files and convert them (regardless of which PDF quality I use), the pdf file is fine and displays properly, but the conversion splits each page of the pdf file into four separate pages. I'm guessing that's due to the difference in the resolution between 300 dpi and 120. Any ideas?

    > I'm trying to create a pages document that can be exported as a pdf, then converted to an ebook for uploading to an iPad.
    There are several formats for e-paper and e-book interchange, and the several formats are in two main document models. One set of formats follows from ISO 8879 Standard Generalized Markup Language and the other set of formats follows from ISO-IEC 10180 Standard Page Description Language. For instance, the e-Pub and HTML formats follow from ISO 8879 and the PostScript and PDF formats from ISO-IEC 10180.
    > I've set the document size to 5"x7.5" (2x3 ratio) but can't find a method to set the document resoluton to 120 dpi.
    In the PS and PDF family of formats, document co-ordinate space has no resolution (: it is resolution indepedent). Objects in the co-ordinate space can either be resolution-independent (: scalable shapes that only get a resolution when they are rasterised to a specific device, for instance, TrueType typography, Type 1 typography, lines, and boxes), or resolution-dependent, for instance, photography.
    For resolution-dependent objects, applications support two workflows. Some applications such as Apple Pages work on the assumption that you set the resolution in the software you use for exposure correction, other applications such as Adobe InDesign and QuarkXPress work on the assumption that you can do this later when the publication is processed. However, since you can't upsample from a lower to a higher resolution successfully in QuarkXPress or InDesign, it makes no difference if you don't save the resolution you need from the source application software.
    So, begin by selecting the photographs you want, correct the exposures, and save the exposures with the ICC profile for the colour correction space into a named folder at the resolution you want. Then place them in whatever application you want, and save into PDF.
    > but the conversion splits each page of the pdf file into four separate pages. I'm guessing that's due to the difference in the resolution between 300 dpi and 120. Any ideas?
    Since the document co-ordinate space in PostScript version twenty-something in the original Apple LaserWriter of January 1985 is always resolution-independent, it has been possible to tile several pages in the document space onto a single page in the device space of the printer. The number of pages you can tile depends in principle on the tiling geometry in the application that writes the page description program (2-up, 4-up, 8-up, 16-up and so forth), and in practice on the size of the printer format (A4, A3, A3 and so forth).
    If a single page is split into several pages, then either the user has to have asked for this (for instance, when proofing a very large document co-ordinate space by tiling it onto a very small device space for a poster on a LaserWriter), or the user has to have accidentally made the settings for the printing system assume that this is the case. Without knowing what printer or what printer driver you have installed, a suggestion might be that your printer driver is passing the wrong information backwards to the system software. Printer drivers are made by printer manufacturers and may be specific to the printer model. You might have more luck if you ask the printer manufacturer's list. Otherwise, try the formatting option 'for any printer' when you write out your PDF page description program, open the page description program in Apple Preview, and then let the printing system do what it does - hopefully to your satisfaction.
    Best,
    Henrik

  • Using Document Filters with the Japanese character sets

    Not sure if this belongs here or on the Swing Topic but here goes:
    I have been requested to restrict entry in a JTextField to English alphaNumeric and Full-width Katakana.
    The East Asian language support also allows Hiragana and Half-width Katakana.
    I have tried to attach a DocumentFilter. The filter employs a ValidateString method which strips all non (Latin) alphaNumerics as well as anything in the Hiragana, or Half-width Katakana ranges. The code is pretty simple (Most of the code below is dedicated to debugging):
    public class KatakanaInputFilter extends DocumentFilter
         private static int LOW_KATAKANA_RANGE = 0x30A0;
         private static int LOW_HALF_KATAKANA_RANGE = 0xFF66;
         private static int HIGH_HALF_KATAKANA_RANGE = 0xFFEE;
         private static int LOW_HIRAGANA_RANGE = 0x3041;
         public KatakanaInputFilter()
              super();
         @Override
         public void replace(FilterBypass fb, int offset, int length, String text,
                   AttributeSet attrs) throws BadLocationException
              super.replace(fb, offset, length, validateString(text, offset), null);
         @Override
         public void remove(FilterBypass fb, int offset, int length)
                   throws BadLocationException
              super.remove(fb, offset, length);
         // @Override
         public void insertString(FilterBypass fb, int offset, String string,
                   AttributeSet attr) throws BadLocationException
              String newString = new String();
              for (int i = 0; i < string.length(); i++)
                   int unicodePoint = string.codePointAt(i);
                   newString += String.format("[%x] ", unicodePoint);
              String oldString = new String();
              int len = fb.getDocument().getLength();
              if (len > 0)
                   String fbText = fb.getDocument().getText(0, len);
                   for (int i = 0; i < len; i++)
                        int unicodePoint = fbText.codePointAt(i);
                        oldString += String.format("[%x] ", unicodePoint);
              System.out.format("insertString %s into %s at location %d\n",
                        newString, oldString, offset);
              super.insertString(fb, offset, validateString(string, offset), attr);
              len = fb.getDocument().getLength();
              if (len > 0)
                   String fbText = fb.getDocument().getText(0, len);
                   for (int i = 0; i < len; i++)
                        int unicodePoint = fbText.codePointAt(i);
                        oldString += String.format("[%x] ", unicodePoint);
              System.out.format("document changed to %s\n\n", oldString);
         public String validateString(String text, int offset)
              if (text == null)
                   return new String();
              String validText = new String();
              for (int i = 0; i < text.length(); i++)
                   int unicodePoint = text.codePointAt(i);
                   boolean acceptChar = false;
                   if (unicodePoint < LOW_KATAKANA_RANGE)
                        if ((unicodePoint < 0x30 || unicodePoint > 0x7a)
                                  || (unicodePoint > 0x3a && unicodePoint < 0x41)
                                  || (unicodePoint > 0x59 && unicodePoint < 0x61))
                             acceptChar = false;
                        else
                             acceptChar = true;
                   else
                        if ((unicodePoint >= LOW_HALF_KATAKANA_RANGE && unicodePoint <= HIGH_HALF_KATAKANA_RANGE)
                                  || (unicodePoint >= LOW_HIRAGANA_RANGE && unicodePoint <= LOW_HIRAGANA_RANGE))
                             acceptChar = false;
                        else
                             acceptChar = true;
                   if (acceptChar == true)
                        System.out.format("     Accepted code point = %x\n",
                                  unicodePoint);
                        validText += text.charAt(i);
                   else
                        System.out.format("     Rejected code point = %x\n",
                                  unicodePoint);
              String newString = "";
              for (int i = 0; i < validText.length(); i++)
                   int unicodePoint = validText.codePointAt(i);
                   newString += String.format("[%x] ", unicodePoint);
              System.out.format("ValidatedString = %s\n", newString);
              return validText;
          * @param args
         public static void main(String[] args)
              Runnable runner = new Runnable()
                   public void run()
                        JFrame frame = new JFrame("Katakana Input Filter");
                        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                        frame.setLayout(new GridLayout(2, 2));
                        frame.add(new JLabel("Text"));
                        JTextField textFieldOne = new JTextField();
                        Document textDocOne = textFieldOne.getDocument();
                        DocumentFilter filterOne = new KatakanaInputFilter();
                        ((AbstractDocument) textDocOne).setDocumentFilter(filterOne);
                        textFieldOne.setDocument(textDocOne);
                        frame.add(textFieldOne);
                        frame.setSize(250, 90);
                        frame.setVisible(true);
              EventQueue.invokeLater(runner);
    }I run this code, use the language bar to switch to Full-width Katakana and type "y" followed by "u" which forms a valid Katakana character. I then used the language bar to switch to Hiragana and retyped the "Y" followed by "u". When the code sees the Hiragana codepoint generated by this key combination it rejects it. My debugging statements show that the document is properly updated. However, when I type the next character, I find that the previously rejected codePoint is being sent back to my insert method. It appears that the text somehow got cached in the composedTextContent of the JTextField.
    Here is the output of the program when I follow the steps I just outlined:
    insertString [ff59] into at location 0 <== typed y (Katakana)
    Accepted code point = ff59
    ValidatedString = [ff59]
    document changed to [ff59]
    insertString [30e6] into at location 0 <== typed u (Katakana)
    Accepted code point = 30e6
    ValidatedString = [30e6]
    document changed to [30e6]
    insertString [30e6] [ff59] into at location 0 <== typed y (Hiragna)
    Accepted code point = 30e6
    Accepted code point = ff59
    ValidatedString = [30e6] [ff59]
    document changed to [30e6] [ff59]
    insertString [30e6] [3086] into at location 0 <== typed u (Hiragana)
    Accepted code point = 30e6
    Rejected code point = 3086
    ValidatedString = [30e6]
    document changed to [30e6]
    insertString [30e6] [3086] [ff59] into at location 0 <== typed u (Hiragana)
    Accepted code point = 30e6
    Rejected code point = 3086
    Accepted code point = ff59
    ValidatedString = [30e6] [ff59]
    document changed to [30e6] [ff59]
    As far as I can tell, the data in the document looks fine. But the JTextField does not have the same data as the document. At this point it is not displaying the ff59 codePoint as a "y" (as it does when first entering the Hiragana character). but it has somehow combined it with another codePoint to form a complete Hiragana character.
    Can anyone see what it is that I am doing wrong? Any help would be appreciated as I am baffled at this point.

    You have a procedure called "remove" but I don't see you calling it from anywhere in your program. When the validation failed, call remove to remove the bad character.
    V.V.

  • Is there a way to cache documents in JEditorPane ?

    I am using a JEditorPane to load html pages.
    some of my pages are quite big and take some time to load. I would like to cache the pages so the next time the user loads a cached page, the page will load very quickly.
    It seems that what I need to cache is the html document that represents the model. However using JEditorPane setDocument( ) method with the cached document takes the same time as loading a new page.
    so perhaps i need to cache the views also ?
    thanks.

    1. I load documents only from the local drive.
    2. The pages I load can be quite big.
    3. I load the pages synchronically
    I have measured a bit of times for loading a big page.
    when the page is new it takes 11 seconds to build the document. with a cached document it takes about 7 seconds.
    the painting of the views takes little time.
    my question is: if I supply the editor pane with a fully built document model, why does it still take him 7 seconds to ready it?
    or if someone knows a way to load a cached document instead of using the setDocument( ) method.
    Thanks

Maybe you are looking for

  • How can I filter as you type on numeric datagridcolumn?

    Hello, I use this script to filter, it works great with string field, but when change it to numeric field (ie. contact_number) I got this error (property length not found on Number and there is no default value. Does any one have any idea why and how

  • IPhone 6 Plus 16GB blue screen crashes: Read, error type:Address map hole or size mis-match

    Hi folks, Some time ago I had a 16GB 6+ and it crashed with the blue screen, so I returned it. I now have a brand new one that I got from Tmobile ($75 return fee) and although it has mostly worked just fine, I have gotten 2 blue screen crashes. Below

  • Drill down report in Portal

    Hi, We have integrated drill down reports in portal 6.0, when i got to the drill down reports after execution,after that i go to context menu -> go to -> perticular report, it is opening in new window. how can i open that in content area of the porta

  • Open TIF files in ACR 4.5

    I have a number of images in TIF format that I wish to open in ACR 4.5. I can see how to open JPG images but not the TIF images. How might I do this? I am using Windows XP Pro SP2, Photoshop CS3, ACR 4.5. Thanks, Tom

  • URGENT: OBIEE Lineage Reporting

    Experts, I need to generate a report in Answers which will show me the following info: Answer Request/Report Name, Answers Column Name, Answers Folder Name, DB Column Name, DB Table Name . In Oracle Discoverer there is EUL Admiinstration Business Are