Wrong receiever component

Hello All,
Today I'v seen a strange issue in PI thatwe'v sent 30 IDoc's from SAP system to PI .
In 28 out of 30 went to correct receiever but 2 IDocs gone to wrong receiever component .
Even This IDoc interface is not presnt anywhere in the configuration ....
anyclue why it happens ...
Thanks .

Hello,
Please check the following notes for this issue:
1305273 - IDoc adapter: Incorrect outbound binding
1301363 - XI Routing: Receiver party determined incorrectly
1163661 - Incorrect receiver if packaging is active
1269336 - Packaging: No receiver can be determined
Regards,
Sarah

Similar Messages

  • Material ledger wrong cost component split

    i have change the price detemination from '2' to '3' in the material ledger in period 04/2011.
    now i wont to execute costing run for actual cost in period 10/2010. to do this i have update tables CKMLPRKEKO e CKMLPRKEPH..
    in this mode I don't have error in costing run, but i have a big problem . i don'have a correct cost component split becouse all the value is on row material.
    i give a look to the SAP table and i find table MLAUFKEPH and table MLKEPH that don't have data for period 10/2010.
    someone can help me?
    thank you.
    Your issue is not related to FI but with MM, therefore your thread was moved to MM forum so the experts will be able to help you better.
    FI Moderator.

    I think this table gets updated only during changes to the material price(Accounting View) thats basically price change.
    Once the Material is created, price changes are carried out using MR21.
    Rajeev

  • SMD: Wrong system component definition from SMSY

    Hi!
    I am using SOLMAN 7.0 EhP1 and have successfully set up SMD functionility.
    Among other I have a SAP Enterprise Portal 7.0 that of course has only J2EE stack.
    When I look into SMSY SOLMAN addes for my Portal with only J2EE stack additionaly ABAP stack.
    This setting troubles the SMD set up via http://server:port/smd because I do not have any ABAP stack within my Portal.
    Does some one know some workaround for this problem?
    Thank you very much!
    Jürgen

    Hi Jürgen,
    there are 2 possible causes for this problem:
    1. Your PPMS data is outdated: Note 1283307 https://service.sap.com/sap/support/notes/1283307
    2. Implement the following note on your system: 1301106 https://service.sap.com/sap/support/notes/1301106
    You can also use the central correction note 1172948 for EhP1 which contains all known issues for the basic scenarios in EhP1 (this includes Diagnostics)
    Best regards
    Michael

  • Can we Set the Default SAP Component while Creating Support Message

    Hi Friends,
        I Have got requirement like, when we create the support desk message from any application system by default the sap component should get selected which we have determined in Solman.Our Business secnario is too complex user give create the support message without giving the Sap Component or they give wrong sap Component, so we want to set the sap component get selected by default while creating the support desk message, guide me in solving this issue.
      Regards
        Charan

    I think your logic is reversed.  I think it's better to let users create messages from the application areas from which they are having the problem.  Based on the standard SAP component which defaults into the component field, the ticket can be routed to one of your 20 teams.  This is where the agent detemination rule for support team can be configured.  There are a number of message on the forum regarding support team configuration.  This way, if your 20 teams can't solve the problem (for example SAP defect) then the message can be forwarded directly to SAP using the correct component.  Good luck.

  • Setting color of a specific line?

    okay so in swing is it possible to set a portion of the text in a text field to a different color? Like in my chat program(below) can I make it so all incoming chat(instring) is blue and all outgoing text(string) is red?
    Am I using the wrong text component for changing the color of a line? Should I even be using J text components for this?
    The tutorial often puts tons of different text components in to its examples, and uses odd methods to change the color.
    It seems that I have to use something like setCaretColor, but i am not clear on how to use this in the way I want to use it.
    here is the code:
    import java.io.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    import javax.swing.JOptionPane;
    import javax.swing.JDialog;
    import javax.swing.JTextField;
    import java.beans.*; //property change stuff
    import java.awt.*;
    import java.awt.event.*;
    public class server extends JFrame implements ActionListener
         JButton recieve;
         String string;
            String instring;
         String aft = " ";
         String bef = " ";
         String allchat=" ";
         JTextField towrite;
         boolean stop = false;
         String name;
         JTextArea chatbox;
         public server(){
                             setSize(490,550);
                             getContentPane().setLayout(null);
                             recieve = new JButton("send message");
                             recieve.setBounds(30,150,150,35);
                             getContentPane().add(recieve);
                                       recieve.addActionListener(this);
                             chatbox = new JTextArea("chat goes here");
                             chatbox.setEditable(false);
                             chatbox.setBounds(10,200,460,270);
                             getContentPane().add(chatbox);
                                            towrite = new JTextField("Write message here");
                             towrite.setBounds(10,475,460,35);
                             getContentPane().add(towrite);
                                            towrite.addActionListener(this);
                             setVisible(true);
                   name = (String)JOptionPane.showInputDialog(null,"Enter your name");
              while(stop==false){
                   try
                   ServerSocket socket = new ServerSocket(4019);
                   Socket insocket =socket.accept();
                   BufferedReader in = new BufferedReader (new InputStreamReader(insocket.getInputStream()));
                   instring = in.readLine();
                   socket.close();
                   bef = instring;
                   if(bef.equals(aft)){}else{
                        allchat=instring+"\n"+allchat;
                        chatbox.setText(allchat);
    catch(Exception e){}
             public void actionPerformed(ActionEvent evt)
            if(evt.getActionCommand().equals("send message"))
    try
    Socket socket = new Socket("67.166.126.246",4020);
    OutputStream out = socket.getOutputStream();
    string=name+": "+towrite.getText();
    byte buffer[] = string.getBytes();
    out.write(buffer);
    socket.close();
    catch(Exception e){}
                   bef = string;
                   if(bef.equals(aft)){}else{
                        allchat=string+"\n"+allchat;
                        chatbox.setText(allchat);
                   aft=bef;
    public static void main(String[] args)
    server s = new server();}}

    Hmmmm im sorry but Im not quite sure I understand how to do this.
    Do you have to know the exact digits at which the text starts and ends?
    or can you, as mentioned just use html tags to set the text color?
    If i were to highlight a line of the text, would that text be highlighted even if its location in the string changed?
    It would seem that tags would be easier but from what I have tried they don't seem to work in editor panes, but the ydo work in buttons
    Im sorry, Im being a bit of a pest, but I have not been doing java for that long, and I do not have a teacher, so all of my questions have to go here.

  • MSS business Pack 60.1.2 iviews (Appraisals)

    We are using MSS business Pack 60.1.2. Two iviews with in
    the 'Staff' workset group,
    a.  AppraisalOverview
    and
    b.  EditAppraisal
    are calling a function module groups
    HRWPC_APPRAISALSOVERVIEW
    and
    HRWPC_APPRAISAL
    which seem like using the old tables belonging to the
    previous release of 50.4 or older.
    Did any one ran in to this situation, and found any
    solution ?
    This seems like case for an OSS message, and I searched
    for one, but I can't find. So I want to make sure it is
    an established problem or not.
    Thanks in advance,
    Prasad Nutalapati

    Infact, there is already an OSS message existing. I did
    search with wrong 'application component' name.
    Inbrief, the solution is that you are not supposed to use
    those two iviews with ECC50, since they belong to prior
    release of HR implementation.
    Hope this helps,
    Prasad Nutalapati

  • JMS -- PI -- IDOC Party Communication

    Hi,
    I have a scenario JMS --> PI --> IDOC and vice-versa. JMS is an external system, so using PARTY communication. SAP System is within customer landspace.
    My doubt is - I have to import a Business System in ID for the IDOC (SAP system). Now where should I import this Business System? Should I import the SAP Business System under Party or under Without Party?
    If I am not wrong Business Component for JMS will come under the Party; have a doubt about the Business System.
    Thank you,
    Pankaj.

    If this is in another landscape then use Party..
    Ok. So nowI have imported the Business System (SAP ECC) under Without Party and will create the Business Component for JMS under Party.
    Thank you,
    Pankaj.

  • CRM business package 60.1.2 vs 60.2.3

    Hi,
    We are currrently investigatiing integrating CRM 4.0 functionality into Portal 6.0 SP19 using business packages.
    I would like to know what are the main differneces between CRM Business Packages 60.1.2 and 60.2.3?
    The link to online documentation via https://www.sdn.sap.com/irj/sdn/contentportfolio seems to point to the same information for both. (http://help.sap.com/Business_Packages/EN/93/35C73C3D91995BE10000000A114084/frameset.htm)
    Which is the correct version to use with SAP Best Practices V2.60, N12?
    Regards
    Sunil

    Infact, there is already an OSS message existing. I did
    search with wrong 'application component' name.
    Inbrief, the solution is that you are not supposed to use
    those two iviews with ECC50, since they belong to prior
    release of HR implementation.
    Hope this helps,
    Prasad Nutalapati

  • ABAP / using of 'balance sheet structure' or 'cost element group structure'

    Hi together,
    is it possible to use balance sheet structures (trx. ob58) or cost element group strucutures within an ABAP coding?
    (including total and subtotal lines)
    It would be great if there is any function module or class...
    Thanks for any help

    Hi Shreenath
    This is very much possibie and correct as well
    Eg: You assign GL 123456 to SFG Material ABC... In Itemization, this GL would show you a value of say, 100 USD
    When you execute cost run of XYZ, which contains ABC - This 100 will show against GL 123456.. BUt, this 100 would comprise of raw mat, labor, power, overheads, etc
    So, at component level the secondary cost element for Labor, power, Overheads will roll up to respective components in CCS.. Hence, this difference is very much possible
    I dont know if the same is the case with you.... As long as the total is matching, you should not worry.... I have full faith in this aspect of the system that it would never assign a GL to wrong cost component
    Regards
    Ajay M

  • Problems with focus traversal after moving to j2sdk_1.4.1_02

    Hi,
    Just moved to j2sdk_1.4.1_02 and we are having problems where
    focus stays on wrong UI component e.g. a user(user2) is taking edit/write permissions from another user(user1) that has write permissions. User1 is told that they will lose write permissions in
    the next 15 minutes ( information dialog displayed on their screen ) while at the same time on user2's window a text label is updated
    every 5 seconds to say how long before they will have write permissions,
    however, the information dialog displayed on user1 hangs and
    the user can't remove this dialog. Control seems to stay with user2.
    This used to work with the previous java version we used.
    Hope someone can help,
    Thanks

    Didn't say what version you came FROM, but I'm guessing if
    you're having focus related problems it was from PRIOR to 1.4
    when focus handling was revamped.
    You probably need to make sure you are using requestFocusInWindow()
    everywhere instead of requestFocus().
    Check here and possibly search for 1.4 and KeyboardFocusManager
    for new focus handling tutorials.

  • Updating the bills of ATO items

    Hi,
    We have identified one of the component in top ATO Model bills with wrong UOM.
    ATO items (config items) were already created with this wrong UOM component (as part of bills).
    Now we created a new part with correct UOM and assigned it to top ATO Model.
    How to update all the these ATO items (bills) with new part/component.
    Thanks,
    Srini.

    Another way to create itemRenderer for datagrid is to have a custom components that implements these objects
    mx.controls.listClasses.IDropInListItemRenderer,mx.controls.listClasses.IListItemRenderer, mx.core.IFactory
    For example
    <s:SkinnableContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    implements="mx.controls.listClasses.IDropInListItemRenderer,mx.controls.listClasses.IListItemRenderer, mx.core.IFactory">
    private var _data:Object;
    private var _listData:BaseListData;
    public function newInstance():*
         return new myItemRenderer; // name of your renderer
    public function set data(value:Object):void
         dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
    [Bindable("dataChange")]
    public function get data():Object
    public function set listData(value:BaseListData):void
    public function get listData():BaseListData
    </s:SkinnableContainer>

  • What's wrong with my component?

    i make a new component which is a dragable icon here is my piece of code
    //class: DragAbleComponent.the father of my component
    import java.awt.Graphics;
    import java.awt.event.FocusEvent;
    import java.awt.event.FocusListener;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.awt.event.MouseMotionListener;
    import javax.accessibility.Accessible;
    import javax.swing.JComponent;
    public abstract class DragAbleComponent extends JComponent implements MouseListener,
              FocusListener, Accessible ,MouseMotionListener{
         private int X;
         private int Y;
         private static final long serialVersionUID = 1L;
         public void mouseClicked(MouseEvent e) {
              this.requestFocusInWindow();
         public void mouseEntered(MouseEvent e) {}
         public void mouseExited(MouseEvent e) {}
         public void mousePressed(MouseEvent e) {}
         public void mouseReleased(MouseEvent e) {}
         public void focusGained(FocusEvent e) {
              this.repaint();}
         public void focusLost(FocusEvent e) {
         this.repaint();}
         protected abstract void paintComponent(Graphics graphics);
         public int getX() {
              return X;
         public void setX(int x) {
              X = x;
         public int getY() {
              return Y;
         public void setY(int y) {
              Y = y;
    //class:DragableIcon the component
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Image;
    import java.awt.event.InputEvent;
    import java.awt.event.MouseEvent;
    import javax.swing.Action;
    import javax.swing.ActionMap;
    import javax.swing.InputMap;
    import javax.swing.JComponent;
    import javax.swing.KeyStroke;
    import javax.swing.TransferHandler;
    public class DragableIcon extends DragAbleComponent {
         private Image image;
         private MouseEvent firstMouseEvent = null;
         private static boolean installKeyBordMapings = true;
         private static final long serialVersionUID = 1L;
         public DragableIcon(Image image) {
              super();
              this.image = image;
              this.setFocusable(true);
              this.addMouseListener(this);
              this.addFocusListener(this);
              this.addMouseMotionListener(this);
              this.initKeyBordMaping();
         private void initKeyBordMaping(){
              if (installKeyBordMapings) {
         InputMap imap = this.getInputMap();
    //     imap.put(KeyStroke.getKeyStroke("ctrl X"),
    //     TransferHandler.getCutAction().getValue(Action.NAME));
         imap.put(KeyStroke.getKeyStroke("ctrl C"),
         TransferHandler.getCopyAction().getValue(Action.NAME));
         imap.put(KeyStroke.getKeyStroke("ctrl V"),
         TransferHandler.getPasteAction().getValue(Action.NAME));
              ActionMap map = this.getActionMap();
    //     map.put(TransferHandler.getCutAction().getValue(Action.NAME),
    //     TransferHandler.getCutAction());
         map.put(TransferHandler.getCopyAction().getValue(Action.NAME),
         TransferHandler.getCopyAction());
         map.put(TransferHandler.getPasteAction().getValue(Action.NAME),
         TransferHandler.getPasteAction());
         @Override
         protected void paintComponent(Graphics graphics) {
              Graphics g = graphics.create();
         //Draw in our entire space, even if isOpaque is false.
         g.setColor(Color.WHITE);
         g.fillRect(0, 0, image == null ? 125 : image.getWidth(this),
         image == null ? 125 : image.getHeight(this));
         if (image != null) {
         //Draw image at its natural size of 125x125.
         g.drawImage(image, 0, 0, this);
         //Add a border, red if picture currently has focus
         if (isFocusOwner()) {
         g.setColor(Color.RED);
         } else {
         g.setColor(Color.BLACK);
         g.drawRect(0, 0, image == null ? 125 : image.getWidth(this),
         image == null ? 125 : image.getHeight(this));
         // g.drawImage(image, 0, 0, this);
         g.dispose();
         public void mouseDragged(MouseEvent e) {
    //Don't bother to drag if the component displays no image.
    if (image == null) return;
    if (firstMouseEvent != null) {
    e.consume();
    //If they are holding down the control key, COPY rather than MOVE
    int ctrlMask = InputEvent.CTRL_DOWN_MASK;
    int action = ((e.getModifiersEx() & ctrlMask) == ctrlMask) ?
    TransferHandler.COPY : TransferHandler.MOVE;
    int dx = Math.abs(e.getX() - firstMouseEvent.getX());
    int dy = Math.abs(e.getY() - firstMouseEvent.getY());
    //Arbitrarily define a 5-pixel shift as the
    //official beginning of a drag.
    if (dx > 5 || dy > 5) {
    //This is a drag, not a click.
    JComponent c = (JComponent)e.getSource();
    TransferHandler handler = c.getTransferHandler();
    //Tell the transfer handler to initiate the drag.
    handler.exportAsDrag(c, firstMouseEvent, action);
    firstMouseEvent = null;
         public void mouseMoved(MouseEvent e) {}
         public void mousePressed(MouseEvent e) {
         //Don't bother to drag if there is no image.
         if (image == null) return;
         firstMouseEvent = e;
         e.consume();
         public void mouseReleased(MouseEvent e) {
         firstMouseEvent = null;
         public static boolean isInstallKeyBordMapings() {
              return installKeyBordMapings;
         public static void setInstallKeyBordMapings(boolean installKeyBordMapings) {
              DragableIcon.installKeyBordMapings = installKeyBordMapings;
         public Image getImage() {
              return image;
         public void setImage(Image image) {
              this.image = image;
    //and here is my pane
    import java.awt.BorderLayout;
    import java.awt.event.ItemEvent;
    import java.awt.event.ItemListener;
    import javax.swing.ImageIcon;
    import javax.swing.JPanel;
    import javax.swing.JToolBar;
    import cn.com.ynld.bms.applet.gui.handler.IconTransferHandler;
    import cn.com.ynld.bms.applet.service.TransfAble;
    import cn.com.ynld.bms.applet.service.UpdateAble;
    public class ElectronicPane extends JPanel
                                                                                    implements ItemListener,UpdateAble{
    private UpdateAble updateAble = null;
    private ScrollAbleImage image;
    private JToolBar toolBar;
    private IconTransferHandler handler;
         private static final long serialVersionUID = 1L;
         public ElectronicPane(){
              super(new BorderLayout());
              handler = new IconTransferHandler();
         this.creatToolBar();
         this.add(this.toolBar);
         this.setTransferHandler(handler);
         public void itemStateChanged(ItemEvent e) {}
         public void addTransferAble(String key, TransfAble transferAble) {
              // TODO
         public TransfAble getTransferAble(String key) {
              // TODO
              return null;
         public void removeTransferAble(String key) {
              this.updateAble.removeTransferAble(key);
         public void update(UpdateAble updateAble) {
              this.updateAble = updateAble;
              this.init();
         private void init(){
              this.image = new ScrollAbleImage();
              this.image.update(updateAble);
              this.add(image,BorderLayout.CENTER);
              this.repaint();
              //this.image.repaint();
         private void creatToolBar(){
              this.toolBar = new JToolBar();
              DragableIcon alarm = new DragableIcon(createImageIcon("/root/Desktop/drawing/png-0003.png", "alarm").getImage());
              alarm.setTransferHandler(handler);
              DragableIcon damage = new DragableIcon(createImageIcon("/root/Desktop/drawing/png-0007.png", "device").getImage());
              alarm.setTransferHandler(handler);
              this.toolBar.add(alarm);
              this.toolBar.addSeparator();
              this.toolBar.add(damage);
              this.toolBar.setFloatable(false);
         /** Returns an ImageIcon, or null if the path was invalid. */
    protected static ImageIcon createImageIcon(String path,
    String description) {
    // java.net.URL imageURL = DragPictureDemo.class.getResource(path);
    if (path == null) {
    System.err.println("Resource not found: "
    + path);
    return null;
    } else {
    return new ImageIcon(path, description);
    the problem is i add DragableIcons to my toolbar but only the first icon can be seen!!!!
    what's wrong
    thanks for any help!

    what's wrong
        private void creatToolBar() {
            this.toolBar = new JToolBar();
            ImageIcon alarm = createImageIcon(
                                  "/root/Desktop/drawing/png-0003.png",
                                  "alarm");
    //        alarm.setTransferHandler(handler);
            // register icon with its Action
            alarmAction.putValue(Action.SMALL_ICON, alarm);
            ImageIcon damage = createImageIcon(
                                   "/root/Desktop/drawing/png-0007.png",
                                   "device");
    //        damage.setTransferHandler(handler);
            // set the icon to the Action that will use it
            damageAction.putValue(Action.SMALL_ICON, damage);
            // toolBars are equipped to receive an Action or JComponent
            // they don't know what to do with ImageIcons
            this.toolBar.add(alarmAction);
            this.toolBar.addSeparator();
            this.toolBar.add(damageAction);
            this.toolBar.setFloatable(false);
        /** Returns an ImageIcon, or null if the path was invalid. */
        protected static ImageIcon createImageIcon(String path, String description) {
            // Use the containing class name. This works for static context in
            // which the "this" keyword does not work.
            // Otherwise, you could simply use getResource.
            java.net.URL imageURL = ElectronicPane.class.getResource(path);
            if (path == null) {
                System.err.println("Resource not found: " + path);
                return null;
            } else {
                return new ImageIcon(path, description);
        private Action alarmAction = new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                Toolkit.getDefaultToolkit().beep();
        private Action damageAction = new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                System.out.println("damage action");
        };

  • What's wrong in my customer component

    Hi all,
    I'm newer to JSF, and I am writing a component which extends UICommand,
    The component is same to commandButton exclude that it preventing from duplicately submit .
    When I complete it, I found that it doesn't fire the action. I found that the when the page is submitted by pressing h:commandButton, In the renderer class's docode method,I can get the button's clientID which is pressed.But when I click
    the customer button, there is no my customer button's clientID in the requestParameterMap. Can any body tell me what's wrong .
    here is my renderer's decode method:
    public void decode(FacesContext context, UIComponent comp) {
            logger.debug("decode begin");
            Map map = context.getExternalContext().getRequestParameterMap();
            for(Iterator ite =map.keySet().iterator();ite.hasNext();){
                logger.debug(ite.next());
            if(map.containsKey(comp.getClientId(context))){
                logger.debug("queue event");
                comp.queueEvent(new ActionEvent(comp));
            } else {
                logger.debug("submitted by other component");
    }

    I got it, thanks . I miss the name property.

  • Wrong component aspect in the design tab of the jsp page

    Hi,
    Don’t know if you can help me, but, I was developing my app and all of the sudden in the design tab of my jsp page the components stop appearing with the correct aspect (that is, a combobox, for example, is a edit with a little button on the side) and started to appear as squares with the name of component above the square.
    I don’t know what I’ve done wrong, and any help would be appreciated.
    Thanks,
    Ana Azevedo

    Thanks for your responses, but I already tried both cases before I posted the thread and neither worked.
    I don't have errors or warnings in the structure panel, creating a new JSP JSF page doesn't work either and I have this situation for 3/4 days, so I reopened JDeveloper a lot in between.
    Meanwhile I started my app all over again because it was still very small (5 pages), but it had some aspects that I'm having difficult to make again, so it was best if I could resolve my problem.
    Thanks again,
    Ana Azevedo

  • Whats wrong with my IP textfield component?

    Hi,
    I have made a component to be used for entering IP Addresses....it should work so that when the user presses a . or TAB, that the cursor moves to the next octet...if the user enters 3 digits, it should go to the next octet... but for some reason it doesnt work. the user can enter as many digits, etc as they want.
    public class IPField extends JFormattedTextField implements ActionListener, KeyListener {
        private ValidationManager validationMgr = new ValidationManager();
        final String mask = "###.###.###.###";
        final String validChars = "0,1,2,3,4,5,6,7,8,9";
        final int focusLostBehavior = JFormattedTextField.PERSIST;
        final int colWidth = 12;
        final Dimension preferredSize = new Dimension(75, 20);
        final int tfAlign = SwingConstants.CENTER;
        final Font tfFont = new Font(null, Font.PLAIN, 14);
        final Border tfBorder = BorderFactory.createLineBorder(Color.black, 1);
        final String errorMsg = "Invaid Entry.  Please enter a valid entry.";
        final String btnTitle = "Show IP";
        private MaskFormatter mf1;
        public IPField() {//throws ParseException {
             //super();
            //MaskFormatter mf1 = new MaskFormatter(mask);
             createMaskFormatter();
            mf1.setValidCharacters(validChars);
            setFormatter(mf1);
            setFocusLostBehavior(focusLostBehavior);
            setColumns(colWidth);
            setPreferredSize(preferredSize);
            setHorizontalAlignment(tfAlign);
            setFont(tfFont);
            setBorder(tfBorder);
            addKeyListener(new KeyAdapter() {
                public void keyTyped(KeyEvent e) {
                    char c = e.getKeyChar();
                    if (c == '.') {
                        int newCaretPos = getNewCaretPos();
                        if (newCaretPos != 999)
                            moveCaret(newCaretPos);
            //KeyBoardFocusManager is used to monitor when TAB is pressed
            KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(new KeyEventDispatcher() {
                public boolean dispatchKeyEvent(KeyEvent e) {
                    if (e.getKeyCode() == KeyEvent.VK_TAB) {
                        int newCaretPos = getNewCaretPos();
                        if (newCaretPos != 999) {
                            moveCaret(newCaretPos);
                        return true;
                    } else {
                        return false;
            //register validationMgr
            validationMgr.register(
                this,
                ValidationConstants.VALIDATE_IP,
                new DefaultJTextComponentHandler(this, errorMsg),
                true);
        private void createMaskFormatter() {
             try {
                   mf1 = new MaskFormatter(mask);
              } catch (ParseException e) {
                   e.printStackTrace();
        public int getNewCaretPos() {
            int curCaretPos = getCaretPosition();
            switch (curCaretPos) {
                case 0 :
                    return 0;
                case 1 :
                case 2 :
                    return 4;
                case 5 :
                case 6 :
                    return 8;
                case 9 :
                case 10 :
                    return 12;
                default :
                    return 999;
        public void moveCaret(int newPos) {
            setCaretPosition(newPos);
        public void actionPerformed(ActionEvent e) {
            if (validationMgr.validate()) {
                getText().replaceAll(" ", "");
        public void keyTyped(KeyEvent e) {
        public void keyPressed(KeyEvent e) {
        public void keyReleased(KeyEvent e) {
    }thanks.

    can u use the latest posting of code, shown below....: this code is exact, nothing is wrong and it compiles:
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.KeyEventDispatcher;
    import java.awt.KeyboardFocusManager;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    import java.awt.event.KeyListener;
    import java.text.ParseException;
    import javax.swing.BorderFactory;
    import javax.swing.JFormattedTextField;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.SwingConstants;
    import javax.swing.border.Border;
    import javax.swing.text.MaskFormatter;
    public class IPField extends JFormattedTextField implements ActionListener, KeyListener {
         final String mask = "###.###.###.###";
         final String validChars = "0,1,2,3,4,5,6,7,8,9";
         final int focusLostBehavior = JFormattedTextField.PERSIST;
         final int colWidth = 12;
         final Dimension preferredSize = new Dimension(75, 20);
         final int tfAlign = SwingConstants.CENTER;
         final Font tfFont = new Font(null, Font.PLAIN, 14);
         final Border tfBorder = BorderFactory.createLineBorder(Color.black, 1);
         final String errorMsg = "Invaid Entry.  Please enter a valid entry.";
         final String btnTitle = "Show IP";
         private MaskFormatter mf1;
         public IPField() {//throws ParseException {
              //super();
              //MaskFormatter mf1 = new MaskFormatter(mask);
              createMaskFormatter();
              mf1.setValidCharacters(validChars);
              setFormatter(mf1);
              setFocusLostBehavior(focusLostBehavior);
              setColumns(colWidth);
              setPreferredSize(preferredSize);
              setHorizontalAlignment(tfAlign);
              setFont(tfFont);
              setBorder(tfBorder);
              addKeyListener(new KeyAdapter() {
                   public void keyTyped(KeyEvent e) {
                        char c = e.getKeyChar();
                        if (c == '.') {
                             int newCaretPos = getNewCaretPos();
                             if (newCaretPos != 999)
                                  moveCaret(newCaretPos);
              //KeyBoardFocusManager is used to monitor when TAB is pressed
              KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(new KeyEventDispatcher() {
                   public boolean dispatchKeyEvent(KeyEvent e) {
                        if (e.getKeyCode() == KeyEvent.VK_TAB) {
                             int newCaretPos = getNewCaretPos();
                             if (newCaretPos != 999) {
                                  moveCaret(newCaretPos);
                             return true;
                        } else {
                             return false;
         private void createMaskFormatter() {
              try {
                   mf1 = new MaskFormatter(mask);
              } catch (ParseException e) {
                   e.printStackTrace();
         public int getNewCaretPos() {
              int curCaretPos = getCaretPosition();
              switch (curCaretPos) {
              case 0 :
                   return 0;
              case 1 :
              case 2 :
                   return 4;
              case 5 :
              case 6 :
                   return 8;
              case 9 :
              case 10 :
                   return 12;
              default :
                   return 999;
         public void moveCaret(int newPos) {
              setCaretPosition(newPos);
         public void actionPerformed(ActionEvent e) {
              getText().replaceAll(" ", "");
         public void keyTyped(KeyEvent e) {
         public void keyPressed(KeyEvent e) {
         public void keyReleased(KeyEvent e) {
         public static void main(String[] args) {
              IPField ip = new IPField();
              JPanel p = new JPanel();
              p.add(ip);
              JFrame f = new JFrame();
              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              f.getContentPane().add(p);
              f.setSize(500,500);
              f.show();
    }

Maybe you are looking for

  • Is it possible to delete everything except your pictures/contacts?

    yeah

  • Classpath on solaris

    I've got the JRE and SDK here. - /usr/j2se - /usr/jdk/latest -> /usr/jdk/jdk1.5.0_14 My working directory is here: - /iwenv/iw-home/custom/scripts/JCA And it contains (non-exclusive) the following files: - dom4j-1.6.1.jar - JCA.jar - xmlimport.sh Apa

  • Want to run the servlet (please help me)

    Hello Guys, I'm very new to java, I have downloaded the tomcat's servlets runner, and could able to write servlets and then could able to compile them without any errors, but the major problem is I'm not at all able to run them, first of all I dont k

  • Problem With Still Photos in iMovie 06

    I am creating a movie that includes still photos. The stills are all imported from iPhoto. The problem is, when i import some of them, the little red bar runs across the bottom of the photo and then it goes black. Photo appears to be gone, just a bla

  • Xml display problem

    Hi experts, I have issue in transfer data from SAP to XML. Program is working perfect. I used in program 2 function modules: u2018SDIXML_DATA_TO_DOMu2019, u2018SDIXML_DOM_TO_XMLu2019 Display data like this: So how can I do that? Please give me some i