Help with realization of a code by "change" event

The form is developed in Live Cycle 9
There is the following code:
var str = rawValue;
var FIO = str.split (' ');
var a = FIO.length
switch (a) {
case 2:{
        FIO [0] = FIO [0].charAt (0).toUpperCase () + FIO [0].substr (1);
        FIO [1] = FIO [1].charAt (0).toUpperCase () + FIO [1].substr (1);
    rawValue = FIO.join (' ');
          break;
     case 3:{
        FIO [0] = FIO [0].charAt (0).toUpperCase () + FIO [0].substr (1);
        FIO [1] = FIO [1].charAt (0).toUpperCase () + FIO [1].substr (1);
        FIO [2] = FIO [2].charAt (0).toUpperCase () + FIO [2].substr (1);
   rawValue = FIO.join (' ');
                break;
case 4:{
        FIO [0] = FIO [0].charAt (0).toUpperCase () + FIO [0].substr (1);
        FIO [1] = FIO [1].charAt (0).toUpperCase () + FIO [1].substr (1);
        FIO [2] = FIO [2].charAt (0).toUpperCase () + FIO [2].substr (1);
        FIO [3] = FIO [3].charAt (0) + FIO [3].substr (1);
    rawValue = FIO.join (' ');
           break;
  default:
    rawValue = str;  
This code works on "exit" event (transfers the first symbols of the first three words to the top register, input of all text happens in the bottom register). How to make the given functionality on "change" event. It is necessary that at once at text input in the field the first symbols of the first those words were removed in the top register.

I need something like these:
<field name="Strachovatel" y="8.65mm" x="3.65mm" w="170mm" h="10mm">
            <ui>
               <textEdit>
                  <border>
                     <?templateDesigner StyleID aped3?>
                     <edge stroke="lowered"/>
                  </border>
                  <margin/>
               </textEdit>
            </ui>
            <font typeface="Myriad Pro"/>
            <margin topInset="1mm" bottomInset="1mm" leftInset="1mm" rightInset="1mm"/>
            <para vAlign="middle"/>
            <caption reserve="45.707mm">
               <para vAlign="middle"/>
               <value>
                  <text>toUpperCase</text>
               </value>
            </caption>
            <event activity="change" name="event__change">
               <script contentType="application/x-javascript">
if (xfa.event.newText.length &gt;xfa.event.prevText.length &amp;&amp;xfa.event.change.length == 1)
xfa.event.change = xfa.form.topmostSubform.variables.Validation.VerchReg(xfa.event.change);
else
xfa.event.change = "";
</script>
            </event>
         </field>
   <?templateDesigner expand 1?></subform>
      <proto/>
      <desc>
         <text name="version">9.0.0.2.20120627.2.874785</text>
      </desc>
      <?templateDesigner Hyphenation excludeInitialCap:1, excludeAllCaps:1, wordCharCnt:7, remainCharCnt:3, pushCharCnt:3?>
      <variables>
         <script contentType="application/x-javascript" name="Validation">
var first=true;
function VerchReg(newsymbol)
var re = /[А-Яа-я-" "]/;
if (re.test(newsymbol))
if (newsymbol==" ")
  first=true;
  return newsymbol;
if (first)
first=false;
return newsymbol.toUpperCase();
else
return newsymbol;
else
return "";
</script>
         <?templateDesigner expand 1?></variables>
      <?templateDesigner expand 1?></subform>
Here only the first character of all words are written in upper case, and we need only the first three words.

Similar Messages

  • Need help with in-line HTML code

    I am trying to write some in-line HTML code to change the background color to blue for Exception-Bad.  Here is my code
    I am trying to use in-line HTML code in WAD to change the background color for Exceptions-Bad to blue.  This is not working.  I really need to get this to work so if someone could tell what is wrong with my code, I would really appreciate the help.
                <style type="text/css" > SAPBEXexcBad7 {background-color: blue}; .SAPBEXexcBad8 {background-color: blue}; SAPBEXexcBad9 {background-color: blue} </style>
    Thanks.
    Ryan

    Hi Boater,
    HTML code will also come like this also
    BODY BACKGROUND="image.jpg" BGCOLOR="#FFFFFF" TEXT="#000000"
    let this one also
    Regards
    Ashwin

  • HELP WITH AN OLDER VERSION CODE!!!!!

    I am trying to figure out how to convert a code from an older version into JDK1.3.1_01.
    Please HELP!
    Here is my code............
    mport java.awt.*;
    import java.applet.*;
    public class Race extends Applet {
    private Button myButton; //use a button to start the race.
    int race_square; //record the race square 70.
    int t_square; //record the tortoise's position.
    int h_square; //record the hare's position.
    int clock; //record clock ticks.
    public void init()
    myButton=new Button("Start Clock") ; //add button to the top of panel.
    add("North",myButton);
    reset_v();
    public void reset_v()
    race_square=70; // total squares is 70
    t_square=1; //start point =1
    h_square=1; //start point=1
    clock=0; //reset the clock to zero.
    public void race() {
    int i=0; //set some integer varibles.
    int t_random=0; //random number for tortoise.
    int h_random=0; //random number for hare.
    Graphics g=getGraphics(); //define graphics.
    Rectangle r = bounds(); //define painting boundary.
    g.drawString("BANG !!!!!",100,r.height/2-80);
    g.drawString("AND THEY'RE OFF !!!!!",100,r.height/2-70);
    g.drawString(Integer.toString(clock),r.width/2,50); //show the zero clock time.
    do{
    try { Thread.sleep(1000);} //clock ticks 1 second.
    catch (InterruptedException e){}
    clock++;
    g.setColor(Color.lightGray); //clear all the old drawings
    g.fillRect(0,0,r.width,r.height);
    g.setColor(Color.black);
    g.drawString(Integer.toString(clock),r.width/2,50); //show the clock time.
    t_random=getrandom(); // FOR TORTOISE
    if (t_random<=5) t_square+=3; // 50% fast plod: 3 squares to the right.
    else if (t_random>5 && t_random<=7)t_square-=6; // 20% slip: 6 squares to the left.
    else t_square+=1; // 30% slow plod: 1 square to the right.
    h_random=getrandom(); //FOR HARE
    if (h_random<=2) {} // 20% sleep: not move at all.
    else if (h_random>2 && h_random<=4)h_square+=9;// 20% big hop: 9 squares to the right.
    else if (h_random==5) h_square-=12; // 10% big slip: 12 squares to the left.
    else if (h_random>5 && h_random<=8)h_square+=1;// 30% slow hop: 1 square to the right.
    else h_square-=2; // 20% small slip: 2 aquares to the left.
    if(t_square<=0) t_square=1; //always start from 1.
    if(t_square>race_square)t_square=race_square;
    if(h_square<=0) h_square=1; //always start from 1.
    if(h_square>race_square)h_square=race_square;
    g.setColor(Color.red); //draw the tortoise's path: use red color.
    g.fillRect(5,r.height/2-5,5*t_square,5);
    g.drawString("T",5*t_square,r.height/2-7);
    g.setColor(Color.blue); //draw the hare path: use blue color.
    g.fillRect(5,r.height/2+1,5*h_square,5);
    g.drawString("H",5*h_square,r.height/2+17);
    g.setColor(Color.black); //draw the race squares.
    g.drawLine(5,r.height/2,5+5*race_square,r.height/2);
    for(i=5;i<=5+5*race_square;i+=5)
    g.drawLine(i,r.height/2-5,i,r.height/2+5);
    if (t_square==h_square &&t_square!=race_square) // tortoise bites the hare.
    g.drawString("OUCH!!!",5+5*h_square,r.height/2-16);
    }while ( t_square=race_square && h_square=race_square && t_square<=5+5*race_square;i+=5)
    g.drawLine(i,r.height/2-5,i,r.height/2+5);
    g.drawString("T",5,r.height/2-7); //mark tortoise
    g.drawString("H",5,r.height/2+17); //mark hare
    public int getrandom()
    return( 1+(int)(Math.random()*10)); // generating the random number 1 to 10.
    public boolean action(Event e, Object arg)
    if (e.target instanceof Button)
    reset_v(); //reset the initial variables.
    race(); //use the button the start the race.
    return true;

    You posted this yesterday, at
    http://forum.java.sun.com/thread.jsp?forum=54&thread=185330
    The code you've posted doesn't seem to include Ilikejava's suggested changes - which are, as far as I can tell, the major changes required to bring your applet in line with Java 1.3.
    It will be easier to help if you show what is wrong with your code, if it's generating a compiler error message or throwing an exception.
    Regards,
    -Troy

  • Query Help with Item Master & Warehouse Code

    Forum,
    I would like help with a query to identify any items within a database where a particular warehouse code does NOT exist against it. At present I have the following:
    select T0.ItemCode, T1.WhsCode from OITM T0
    INNER JOIN OITW T1 on T0.ItemCode = T1.ItemCode
    where T0.ItemCode NOT IN ('WHS1')
    This is returning all other instance and not just a list of item codes where 'WHS1' is missing from within the 'Stock Data' tab.
    Thanks,
    Sarah

    Hi Sarah...
    Try This
    SELECT T0.ItemCode, T0.ItemName, T1.WhsCode
    FROM OITM T0 INNER JOIN OITW T1 ON T0.ItemCode = T1.ItemCode
    WHERE T1.WhsCode not in ( 'WHS1')
    Regards
    Kennedy

  • Help with java digital signing code

    hello people.
    can anybody help me?
    i have find a java code to resolve my problem with sending pay in soap envelope with digital signature and attached certificate. i compiled it with jdk jdk1.6.0_37. and it works.
    i need it to work in built-in jvm in oracle 9i. in oracle 9i jvm release is 1.3.1. Java code does not work there. there is an error
    class import com.sun.org.apache.xerces.internal.impl.dv.util.Base64 not found in import.
    i did not find this class in network.
    can anybody help with rewriting it for jvm 1.3.1?
    thanks in advance.
    code below:
    import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;
    import java.io.*;
    import java.security.Key;
    import java.security.KeyStore;
    import java.security.PrivateKey;
    import java.security.Signature;
    import java.security.cert.Certificate;
    public class Sign {
    public static void main(String[] args) throws Exception {
    // TODO code application logic here
    BufferedReader reader = new BufferedReader(new FileReader("c:\\cert.p12"));
    StringBuilder fullText = new StringBuilder();
    String line = reader.readLine();
    while (line != null) {
    fullText.append(line);
    line = reader.readLine();
    KeyStore p12 = KeyStore.getInstance("pkcs12");
    p12.load(new FileInputStream("c:\\cert.p12"), "Hfrtnf$5".toCharArray());
    //????????? ????????? ????, ??? ????? ????? ???????????? alias ? ??????
    //Key key = p12.getKey("my kkb key", "ryba-mech".toCharArray());
    Key key = (Key) p12.getKey("my kkb key", "Hfrtnf$5".toCharArray());
    Certificate userCert = (Certificate) p12.getCertificate("my kkb key");
    String base64Cert = new String(Base64.encode(userCert.getEncoded()));
    //signing
    Signature signer = Signature.getInstance("SHA1withRSA");
    signer.initSign((PrivateKey) key);
    signer.update(fullText.toString().getBytes());
    byte[] digitalSignature = signer.sign();
    String base64sign = new String(Base64.encode(digitalSignature));
    String base64Xml = new String(Base64.encode(fullText.toString().getBytes()));
    System.out.println("<certificate>" + base64Cert+"</certificate>");
    System.out.println("<xmlBody>" + base64Xml+"</xmlBody>");
    System.out.println("<signature>" + base64sign+"</signature>");
    Edited by: user13622283 on 22.01.2013 22:08

    My first search is to see if there is an Apache commons project that provides it. Lo and behold:
    http://commons.apache.org/codec/apidocs/org/apache/commons/codec/binary/Base64.html
    commons-codec.

  • Help with some java login code

    hey,
    I am a new member but used to visit the site regularly. I am undergoing a java project and I cannot seem to get my head around how to code when users log in, there name must appear at the top of each page they visit.
    User enters name into a text box. Do I use getter and setter methods? any bit of help would be of some advantage to me.
    Thanks for your time and I'll help with anyone else who is stuck.

    if JSP or servlet use Session...
    if you are using frame you have to consider... which frame is a top parent. that top frame will have the set and get method.. for you to set and retrieve the user name.. bear in mind that different object will have different user...
    so you have to play fair game ...hehehehe :-)

  • Help with oracle listner after trying to change the hostaname on Fedora 9

    After searching high and low on the internet for help with this error I am coming here for a little assistance with this issue. A week ago I tried to change the hostname of my machine and the connection to my Db stopped working.
    When I type lsnrctl status I get the following messages
    TNS-12537: Tns Connection closed
    TNS-12560: Tns protocol adapter error
    TNS-00507 Tns connection closed
    Linux Erro: 29 Illegal seek
    Then when I try to run netca I get a java vm error sigsev. Can anyone provide assistance.
    This is on an 11g installation
    Thanks
    Edited by: user5599027 on Jan 27, 2009 2:24 PM

    Here is my /etc/hosts file
    >
    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    127.0.0.1          localhost.localdomain localhost localhost
    192.168.0.195          localhost
    Ive reverted everything in an attempt to get it back and running to no avail. And the user I am using is the same user that installed the product
    >
    -rwxr-x--- 1 ldhasty ldhasty 187 2007-05-08 00:03 shrept.lst
    drwxr-x--- 2 ldhasty ldhasty 4096 2008-06-08 15:53 samples
    -rwxr-x--- 1 ldhasty ldhasty 200 2008-06-08 16:01 sqlnet.ora
    -rwxr-x--- 1 ldhasty ldhasty 379 2009-01-27 11:07 listener.ora
    -rwxr-x--- 1 ldhasty ldhasty 322 2009-01-27 17:11 tnsnames.ora
    >
    -rwxr-x--- 1 ldhasty ldhasty 136437 2008-06-08 16:01 lsnrctl

  • Need help with this Pascal Triangle code....

    Hey everyonr i am totally new to Java... so need your help with this code...
    the function makeRows gives me problems... main is correct ... can someone fix my makeRows... i don't see what's wrong
    public class Pascal {
      /** Return ragged array containing the first nRows rows of Pascal's
       *  triangle.
      public static int[][] makeRows(int nRows) {
            int[][] mpr  = new int[nRows+1][];
            int l=0; int r=0;
            for (int row = 0; row < nRows; row++) {
              mpr[row] = new int[row+1];  //index starts at 0
              if (row==0) {
                mpr[0][0]= 1;
                    if (row==1) {
                mpr[1][0]= 1;
                mpr[1][1]= 1;
              if (row>=2) {
                 for (int j = 0; j <= row; j++) {
                    if (j==0)               {l=0;} else {l=mpr[row-1][j-1];}
                    if (j==mpr[row].length-1) {r=0;} else{r=mpr[row-1][j];}
                    mpr[row][j] = l + r;
            return mpr;
      public static void main(String[] args) {
             if (args.length != 1) {
               System.out.println("usage: java " + Pascal.class.getName() + " N_ROWS");
               System.exit(1);
             int nRows = Integer.parseInt(args[0]);
             if (nRows > 0) {
               int[][] pascal = makeRows(nRows);
               for (int[] row : pascal) {
              for (int v : row) System.out.print(v + " ");
              System.out.println("");
         }this makeRows function should return ragged array containing the first nRows rows of Pascal's triangle
    thanks
    Edited by: magic101 on May 9, 2008 4:03 PM

    magic,
    i think corlettk meant that some people might not know what pascal's triangle is.
    also, you didnt say what was wrong with your code, just that it was wrong.
    asking smart questions is about giving as much information you can to get the
    best answer. i would throw a System.out.print between every line of your
    algorithm. i would also supply us with the values you are getting for each row.
    also, this question is asked all the time here. do a forum search.
    1
    11
    121
    1331
    14641

  • Help with understanding multi-threaded code

    Hi Everyone,
    I am currently reading a book on multi-threading and up until recently I have been able to understand what is going on. The thing is the complexity of the code has just jumped up about two gears without warning. The code is now using inner classes which I am trying to develop an understanding of but I am not finding it easy going, and the book has been lite on explanations. If anybody can help with the following code it will be really appreciated.
    public class SetPriority extends Object
         private static Runnable makeRunnable()
              Runnable r = new Runnable()
                   public void run()
                        for(int i=0; i<5; i++)
                             Thread t = Thread.currentThread();
                             System.out.println("in run() - priority=" + t.getPriority() +
                                          ", name=" + t.getName());
                             try{
                                  Thread.sleep(2000);
                             }catch(InterruptedException x){
                                  //ignore
              return r;
         public static void main(String[] args)
              Thread threadA = new Thread(makeRunnable(), "threadA");
              threadA.setPriority(8);
              threadA.start();
              Thread threadB = new Thread(makeRunnable(), "threadB");
              threadB.setPriority(2);
              threadB.start();
              Runnable r = new Runnable()
                   public void run()
                        Thread threadC = new Thread(makeRunnable(), "threadC");
                        threadC.start();
              Thread threadD = new Thread(r, "threadD");
              threadD.setPriority(7);
              threadD.start();
              try{
                   Thread.sleep(3000);
              }catch(InterruptedException x){
                   //ignore
              threadA.setPriority(3);
              System.out.println("in main() - threadA.getPriority()=" + threadA.getPriority());
    }My greatest challenge is understanding how the makeRunnable() method works. I don't understand how this inner class can be declared static and then multiple "instances" created from it. I know that I have no idea what is going on, please help!!!
    Thanks for your time.
    Regards
    Davo
    P.S.: If you know of any really good references on inner classes, particularly URL resources, please let me know. Thanks again.

    Yikes!! The good news is that you're unlikely to see such convoluted code in real life. But here we go.
    "private static Runnable makeRunnable()" declares a method that returns objects of type Runnable. The fact that the method is declared "static" is pretty irrelevant - I'll describe what that means later.
    The body of the method creates and returns an object of type Runnable. Not much special about it, except that you can give such an object to the constructor of class Thread and as a result the run() method of this Runnable object will be called on a new thread of execution (think - in parallel).
    Now the way it creates this Runnable object is by using the "anonymous inner class" syntax. In effect the method is doing the same as
    public class MyNewClass implements Runnable {
        public void run() {
            // All the same code inside run()
    public class SetPriority {
        private static Runnable makeRunnable() {
            Runnable r = new MyNewClass();
            return r;
        // The rest of the original code
    }Except you don't bother declaring MyNewClass. You're not interested in defining any new method signatures. You just want to create an object that implements Runnable and has certain instructions that you want inside the run() method. Think of the whole approach as shorthand.
    Think about this for a while. In the mean time I'll write up the "static".

  • Elasticity: help with converting Flash 5 code to Flash 8

    Hello
    because I have to make a flash menu with elasticity effect I
    came upon this tutorial:
    http://www.kirupa.com/developer/actionscript/spring.htm
    All OK but the code there works only with Flash 5. I somehow
    managed to concoct code that works for Flash 6 but still I didn't
    come even close to a code working in Flash 8. I'm using
    Actionscript only from version 7, I do not know anything about
    Flash 5 and 6. So please, the more experienced guys, help me!!
    The code I concocted is:
    MovieClip.prototype.move = function (centerx, centery,
    inertia, k) {
    this.x = -this._x+centerx;
    this.y = -this._y+centery;
    this.xp = this.xp*inertia+this.x*k;
    this.yp = this.yp*inertia+this.y*k;
    this._x += this.xp;
    this._y += this.yp;
    onEnterFrame=function() {
    this.move (_root._xmouse,_root._ymouse,0.9,0.1) ;
    This whole code is on the timeline of the MC being moved.
    So now the only thing I need is to make this code work for
    Flash 8
    Please, help

    Just managed to do it !

  • I dropped my iphone 3G last day and soon after the display became very dim and it still remanins the same..Could anyone pls help with a solution? Should I change the display or is it a minor damage?

    I dropped my iPhone 3G last day and soon after that the display turned too dim and it still remains the same.
    Could anyone help me with a solution?
    Should I change the display or is it a minor damage??
    Thanks for your support

    sounds like you broke the display when you dropped it.  There's nothing we users here can do for you.
    Since the iPhone warranty does not cover accidental damage, you will have to pay to have your phone repaired or replaced.  You can bring it into Apple for an out of warranty exchange in the country of purchase, or you can find a 3rd party iPhone repair store in your area.

  • Need help with an error message when making changes to an IMAP account

    I have several IMAP accounts in my Mac Mail. Today when I tried to edit the, "Full Name" associated with the account I got an error message that said:
    Invalid Directory
    The account path /Users/kristen/Library/Mail/[email protected]@host365.ISPhost.com is already being used by the account "Silver"
    Did I somehow corrupt something? I'm not sure why making this small change to the full name would cause such an error. Please help.
    Thanks!!

    stop() forcibly kills a thread. You shouldn't use this method because if the thread is in a critical section of code, you can cause data corruption or deadlock.
    Instead, if you need to stop execution from another thread, invoke the interrupt() method.
    Good luck.

  • Need help with paint (here my code)

    hi, i have problem with my paint method, if i put super.paint(g); all work perfectly but when you draw the program refresh all time, and does like flash effect taht i dotn want (test the code you'll see what im talking about) , and if i dont put super.paint(g) my component didnt paint... please help me, i know taht is a little bug, but i didnt have any kind of problem with swing before..
    thx
    //Debut imports
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.net.*;
    import javax.swing.border.*;
    import javax.swing.event.*;
    //Fin imports
    //  Class: soudure
    public class soudure extends JApplet implements MouseListener, MouseMotionListener, ChangeListener
        //Debut Declarations
        boolean dessinConfig = false; //Savoir quand on utilise paint pour config
        Image img; //Image a dessiner
        int x = -1; //Sert pour savoir le point x de la souris
        int y = -1; //Sert pour savoir le point y de la souris
        int ovalHeight = 10; //Set la hauteur de l'oval
        int ovalWidth = 10; //Set la largeur de l'oval
        JLabel xCoord, //Coordonner de la souris X
               yCoord, //Coordonner de la souris Y
               lVoltage, //Identifie le voltage
               lAmperage; //Indeitifie l'amperage
        JPanel config, //Panel de configuration
               dessin, //Panel de dessin
               info; //Panel d'info
        JSlider voltage, //Set le voltage
                amperage; //Set l'amperage
        Vector sauvOvalXY; //Sauvegarde les points x et y des ovals
        Vector sauvOvalWH;  //Sauvegarde les largeur et hauteur des ovals
        //Fin Declarations
        //  Fonction: init()
        public void init()
            //Debut Initialisations
            config = new JPanel();   
            dessin = new JPanel();
            info = new JPanel();
            xCoord = new JLabel("X Coord.: ");
            yCoord = new JLabel("Y Coord.: ");
            voltage = new JSlider(JSlider.VERTICAL, 15,30,15);
            lVoltage = new JLabel("Voltage  15 :");
            amperage = new JSlider(JSlider.VERTICAL, 100,400,100);
            lAmperage = new JLabel("Amperage  100 :");
    //      img = new Image();
          sauvOvalXY = new Vector();
          sauvOvalWH = new Vector();
            //Fin Initialisations
            //Debut set Background
            config.setBackground(Color.lightGray);       
            dessin.setBackground(Color.white);
            //Fin set Background
            //Debut set layout
            dessin.setLayout(null);
            //Fin Set Layout
            //Add les listener
            dessin.addMouseListener(this);
            dessin.addMouseMotionListener(this);
            voltage.addChangeListener(this);
            amperage.addChangeListener(this);       
            //Fin Add listener
            //Divers settings
            dessin.setBorder(new MatteBorder(1,1,1,1,Color.black));
            config.setBorder(new MatteBorder(1,1,1,1,Color.black));
            info.setBorder(new MatteBorder(1,1,1,1,Color.black));
            voltage.setSize(20,10);
            amperage.setSize(20,10);
            //Set Size
            getContentPane().setSize(500,500);
            config.setBounds(0,0,500,100);
            dessin.setBounds(0,100,500,300);
            info.setBounds(0,400,500,100);       
            //Fin set Size
            //Debut ajout Panel
            info.add(xCoord);
            info.add(yCoord);
            config.add(lVoltage);
            config.add(voltage);
            config.add(lAmperage);
            config.add(amperage);
            getContentPane().add(config,"North");
            getContentPane().add(dessin,"Center");
            getContentPane().add(info,"South");       
            //Fin ajout Panel       
        //Fin Fonction init()
        //  Fonction: mouseClicked(MouseEvent)
        public void mouseClicked(MouseEvent e)
        //Fin Fonction mouseClicked(MouseEvent)
        //  Fonction: mouseDragged(MouseEvent)
        public void mouseDragged(MouseEvent e)
            //Prend l'objet sur lequel l'event est fait
            Object obj = e.getSource();
            x = e.getX();
            y = e.getY();
            //JPanel Dessin
            if(obj == dessin)
                repaint();
                positionSouris(e);
            //Fin JPanel dessin
        //Fin Fonction mouseDragged(MouseEvent)
        //  Fonction: mouseEntered(MouseEvent)
        public void mouseEntered(MouseEvent e)
            //positionSouris(e);
        //Fin Fonction mouseEntered(MouseEvent)
        //  Fonction: mouseExited(MouseEvent)
        public void mouseExited(MouseEvent e)
            //Met les coords de la souris a 0
            xCoord.setText("X Coord.: 0");
            yCoord.setText("Y Coord.: 0");
        //Fin Fonction mouseExited(MouseEvent)
        //  Fonction: mouseMoved(MouseEvent)
        public void mouseMoved(MouseEvent e)
            positionSouris(e);
        //Fin Fonction mouseMoved(MouseEvent)
        //  Fonction: mousePressed(MouseEvent)
        public void mousePressed(MouseEvent e)
        //Fin Fonction mousePressed(MouseEvent)
        //  Fonction: mouseReleased(MouseEvent)
        public void mouseReleased(MouseEvent e)
        //Fin Fonction mouseReleased(MouseEvent)
        //  Fonction: paint(Graphics)
        public void paint(Graphics g)
            super.paint(g);
            g = dessin.getGraphics();
            //Verifie si rien n'a encore ete dragger
            if(x != -1)
                //Sauvegarde les infos
                sauvOvalXY.add(new Point(x,y));
                sauvOvalWH.add(new Point(ovalWidth,ovalHeight));
                //Dessine les sauvegarde
                int size = sauvOvalXY.size();
                for(int i=0;i<size;i++)
                    Point tmpXY = (Point)sauvOvalXY.get(i);
                    Point tmpWH = (Point)sauvOvalWH.get(i);
                    g.fillOval(tmpXY.x,tmpXY.y,tmpWH.x,tmpWH.y);
                g.fillOval(x,y,this.ovalWidth,this.ovalHeight);
    /*        //Si dessine pour panel config
            if(dessinConfig)
                g = config.getGraphics();
                g.drawImage(img,0,0,100,100,this);
               // dessinConfig = false;
        //Fin Fonction paint(Graphics)
        //  Fonction: positionSouris(MouseEvent)
        public void positionSouris(MouseEvent e)
            int tmpX = e.getX();
            int tmpY = e.getY();
            xCoord.setText("X Coord.: " + Integer.toString(tmpX));
            yCoord.setText("Y Coord.: " + Integer.toString(tmpY));
        //Fin Fonction positionSouris(MouseEvent)
        //  Fonction: stateChanged(ChangeEvent)
        public void stateChanged(ChangeEvent e)
            //Verifie lobject actuel
            Object obj = e.getSource();
            //Voltage
            if(obj == voltage)
                int tmpVoltage = voltage.getValue();
                lVoltage.setText("Voltage  " + Integer.toString(tmpVoltage) + " :");
            //Fin voltage
            else
                //Voltage
                if(obj == amperage)
                    int tmpAmperage = amperage.getValue();
                    lAmperage.setText("Amperage  " + Integer.toString(tmpAmperage) + " :");
                //Fin voltage       
        //Fin Fonction stateChanged(ChangeEvent)
    }

    Hi,
    For Swing components you need to override the paintComponent method instead of paint. In your case you can't do that with the approach you have taken. Here is how you can do it:
    1. Remove your paint method
    2. Change your creation of the dessin JPanel and override its' paintComponent method using an anonymous class.
        dessin = new JPanel()
                    public void paintComponent( Graphics g )   
                      super.paintComponent(g);      
                      //Verifie si rien n'a encore ete dragger 
                      if(x != -1)       
                        //Sauvegarde les infos
                        sauvOvalXY.add(new Point(x,y));
                        sauvOvalWH.add(new Point(ovalWidth,ovalHeight));
                        //Dessine les sauvegarde          
                        int size = sauvOvalXY.size(); 
                        for(int i=0;i<size;i++)         
                          Point tmpXY = (Point)sauvOvalXY.get(i);
                          Point tmpWH = (Point)sauvOvalWH.get(i);
                          g.fillOval(tmpXY.x,tmpXY.y,tmpWH.x,tmpWH.y);
                        g.fillOval(x,y,ovalWidth,ovalHeight);
                 };This will allow you to override the correct method and still use all of your applet class variables. Notice that I have removed the line getting the graphics of dessin because it is now being passed into the paintComponent method.
    The two steps above should remove any flashing that you may have had.
    Regards,
    Manfred.

  • Help with dvd drive - region code error

    Hi, I really need to change the drive region code on my Ibook G4 (OS X 10.4.10) back to Region 2. I'm allowed to change it one last time.
    But the trouble is, when I try and change it and click 'set drive region' it just comes up with an error message -70001, 'There was a problem changing the drive region code.'
    I've reset the PMU and PRAM/NVRAM but it still does it.
    Can anybody help me at all? It's driving me mad, I was banking on being able to change it back to my Region one last time...

    Insert a DVD which is set to play in only one region; if you try using up your last change with a DVD that can play in some but not all regions, that error message will appear. Many DVDs which are set to play in region 2 will also play in region 4.
    (23521)

  • Can anyone help with my mail chimp code?

    Hi there,
    Ive just embedded a mail chimp sign up form into the footer of my website. In dreamweaver i changed the font and positioning with css to style it how i wanted.
    It shows up fine in the dreamweaver design window but not upon upload. What have i done wrong?!
    Heres the link - http://www.allroots.org/contact/index.html
    Cheers
    Benn

    Well the creating a css rule without the specific code given on the mail chimp website didnt seem possible. I was only able to edit the text and not the data entry field or submit button. Following the instructions on teh mail chimp website did get me so far but ive hot a brick wall now!
    Heres my source code -
    <!-- Begin MailChimp Signup Form -->
    <link href="http://cdn-images.mailchimp.com/embedcode/slim-081711.css" rel="stylesheet" type="text/css">
    <style type="text/css">
              #mc_embed_signup{background:#7B6E61; clear:left; font:14px Helvetica,Arial,sans-serif;  width:250px; height: 150px;}
              /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
                 We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
    </style>
    <div id="mc_embed_signup">
    <form action="http://allroots.us6.list-manage.com/subscribe/post?u=593e891a11547e228091cba9f&id=3e371df9 46" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
              <label for="mce-EMAIL">Subscribe to our mailing list</label>
              <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
              <div class="clear"><input type="submit" value="go" name="Subscribe" id="mc-embedded-subscribe" class="button"></div>
    </form>
    </div>
    <!--End mc_embed_signup-->
    And heres my CSS -
    #mc_embed_signup {
              margin-right: 45px;
              margin-left: 65px;
    div.mc-field-group label {
    div.mc-field-group input {
    div.mc-field-group select {
    #mc-embedded-subscribe-form {
              font-family: "Londrina Shadow";
              font-size: 24px;
              text-align: center;
    div.mc-field-group {
    div.mc-field-group input {
    input.button {
    #footerfacebook style {
              font-family: Positiv-A;

Maybe you are looking for

  • Need help for performance tunning

    Hello, I have 16K records return by query, it takes long time to proceed for 7K it takes 7.5 sec. Note: I used all seeded tables only. If possible please help me to tune it. SELECT       msi.inventory_item_id,msi.segment1,msi.rimary_uom_code , msi.pr

  • How to download Google maps to iPhone?

    How to download Google Maps to iphone4s?

  • Where's the best place to store email templates?

    Hi all; In a web app I store all my email templates in a files folder in the web app. Can't do that with a worker in a cloud service - no files. So where's the best place to store them? In a BLOB? And if so, is there a way to have files in my project

  • Star Writer - File - Save As - save as type. No menu of file types

    Problem When trying to save a file as specific type, I am NOT presented with a menu of file types. Background Version 9.1.10 (build 9399), running on Windows XP. I have tried with New file, Opened .odt file, Opened .doc file - all same. This is the f

  • OC4J IAS Problem

    Hello, I`m new to deploying stuff in IAS, and I got this problem: Unknown web-site default-web-site, for OC4J instance ormi://localhost:3202 Any clue of what should I check to try solving it? Or may be causing it? Thanks