Static textfields

Hi guys,
I do not know what happens. My input fields do not work and I have no syntax error. I cannot enter data.
This is my code and below my .swf
tks in advance.
package {
  import flash.display.*;
  import flash.text.*;
  import flash.events.MouseEvent;
  public class U1A7_Fidelisation extends MovieClip {
var affichage: String="";
//Déclarer la création du tableau adherents et les varialbes à être utilisés.
  var rang1:Array = [];
  var adherent:Array = [rang1];
  public function U1A7_Fidelisation()
  btnAjouter.addEventListener(MouseEvent.CLICK, ajouter);
  btnAfficher.addEventListener(MouseEvent.CLICK, afficher);
  btnSupprimer.addEventListener(MouseEvent.CLICK, supprimer);
  btnMillesTotale.addEventListener(MouseEvent.CLICK, millesTotale);
//Inclure le fichier externe qui contient la fonction pour caluler les milles accumulés et
//les milles en prime.
  include "U1A7_Milles.as"
  //fonction pour ajouter les renseigments inscrits par l'utilisateur au tableau.
  function ajouter(event:MouseEvent):void
  var nom:String;
  var prenom:String;
      var semaineUne:int;
      var semaineDeux:int;
  var semaineTrois:int;
  var semaineQuatre:int;
  //Extraire les informations nécessaires des champs de saisie.
  prenom = txtPrenom.text;
  nom = txtNom.text;
      semaineUne = int(semaine1.text);
    semaineDeux = int(semaine2.text);
  semaineTrois = int(semaine3.text);
    semaineQuatre = int(semaine4.text);
  adherent.push([prenom, nom, semaineUne, semaineDeux, semaineTrois, semaineQuatre]);
  //fonction pour supprimer les renseigments du tableau.
  function supprimer(event:MouseEvent):void
      var indiceP:int=-1;
      var indiceN:int=-1;
      for (var rang:int = 0; rang < adherent.length; rang++)
        indiceP =(adherent[rang][0].indexOf(txtPrenom.text));
        indiceN =(adherent[rang][1].indexOf(txtNom.text));
        if ((indiceP != -1) && (indiceN != -1)) // prénom et nom ont été repérés.
          adherent.splice(rang,1);  // rang - indique la rangée à supprimer.
    // 1 - indique de supprimer cette rangée seulement.
  //fonction pour afficher afin que tout les renseignements inscrits dans le tableau
  //deviennent visibles.
  function afficher (event:MouseEvent):void
  affichage=("");
  for (var rang:int = 0; rang < adherent.length; rang++)
  for (var col:int = 0; col < adherent[0].length; col++)
  affichage = affichage + " " + adherent[rang][col];
  affichage = affichage + "\n";
  monMessage.text = affichage;
  txtPrenom.text = "";
  txtNom.text = "";
  semaine1.text = "";
  semaine2.text = "";
  semaine3.text = "";
  semaine4.text = "";
  //fonction pour calculer le total de points(milles) accumulés en 4 semaines d'un client
  //et pour voir si ils obtiendront des milles en prime.
  function millesTotale(event:MouseEvent):void
   var prenom2:String;
      var nom2:String;
      var semaineUne2:int;
      var semaineDeux2:int;
   var semaineTrois2:int;
   var semaineQuatre2:int;
   var somme:int;
   var sommeMessage:String;
   affichage = "";
      prenom2 = txtPrenom.text;
   nom2 = txtNom.text;
      semaineUne2 = int(semaine1.text);
   semaineDeux2 = int(semaine2.text);
   semaineTrois2 = int(semaine3.text);
   semaineQuatre2 = int(semaine4.text);
      somme = (semaineUne2 + semaineDeux2 + semaineTrois2 + semaineQuatre2);
     if (somme >= 5000)
  sommeMessage ="1000";
  else if (somme < 5000)
  sommeMessage ="0";
   affichage = (prenom2 + nom2 + " a accumulé " + somme + " milles. Elle/Il a obtenu "  + sommeMessage + " mille(s) en prime.");
  //Afficher le message dans le champ de saisie monMessage. 
   monMessage.text = affichage;
  txtPrenom.text = "";
  txtNom.text = "";
  semaine1.text = "";
  semaine2.text = "";
  semaine3.text = "";
  semaine4.text = "";

can you see your cursor when you click on an input textfield?
if no, there's something overlying it.  if yes, what happens when you type a letter and number?
p.s.  make sure the font color is NOT white, and you should embed your font.
p.p.s.  i just saw you marked ned's response 'correct'.  i don't see any change listeners where that could occur.  you have click listeners but those wouldn't change any textfields unless something is clicked.

Similar Messages

  • Problem reading data from textField?

    I have a problem in my program I'm currently doing.
    I have a textArea and a textField in a container.
    Inside the textArea will be displayed some questions which require user to give answers to in the textField.
    When user types something in the textField and presses enter, an actionListener will trigger and take in String.
    My problem is how do you wait for the user to type something in the textField?
    thanks

    Hi
    I am trying to read a value from a textField object in the following code, but its returning an empty string. any kind of help would be appreciated. thanks.
    bhavesh
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.io.*;
    import java.lang.*;
    public class Applet1 extends Applet implements ActionListener, TextListener{
         String text = "";
         Image logo;
         static TextField usr;
         static TextField pswd;
         static Button logOn;
         public boolean authenticate(Graphics g){
              g.setColor(Color.RED);
              g.setFont(new Font("Monospaced", Font.PLAIN, 20));
              text = "Username:";
              g.drawString(text, 300, 300);
              text = "Password:";
              g.drawString(text, 300, 325);
              g.setFont(new Font("Serif", Font.PLAIN, 20));
              usr = new TextField(40);
              usr.setBounds(420,280, 200,20);
              usr.setEditable(true);
              //usr.addActionListener(this);
              add(usr);
              //add (new Label("Enter number:"));
              pswd = new TextField(40);
              pswd.setEditable(true);
              pswd.setBounds(420,310, 200,20);
              //pswd.addActionListener(this);
              add(pswd);
              //add (new Label("Enter number:"));
         logOn = new Button("Log on ...");
         logOn.setBounds(380,340,80,20);
              logOn.addActionListener(this);
              add(logOn);
              return true;
         public void actionPerformed(ActionEvent ae){
              System.out.print(usr.getText()+"rr\n"+ae);
              System.out.print(pswd.getText()+"bb\n");
              if ( usr.getText().compareTo("gusr")==0 && pswd.getText().compareTo("gpswd")==0 ){
                   System.out.print("COOOOOOL");
              else{
                   System.out.print("BAD");
         public void textValueChanged(TextEvent te){
              String foo = usr.getText();
              System.out.print("\n\nevent please\n\n"+foo+" +"+usr.getSelectedText());
         public void paint(Graphics g) {
              logo = getImage(getCodeBase(),"logo2.gif");
              g.setColor(Color.WHITE);
              g.fillRect(0,0,1000,625);
              g.drawImage(logo, 0, 0, this);
              g.setFont(new Font("SansSerif", Font.ITALIC, 20));
              g.setColor(Color.BLUE);
              text = "Welcome to AMPD Timecard!";
              g.drawString(text, 300, 255);
              authenticate(g);

  • Changing Some Text in TextField

    Hi everyone,
    Hope everyone is doing good..
    Curious if you can change only some text in a TextField rather than all of it...
    Like simple example:
    The Ocean has alot of water...
    And make Ocean blue?
    Thanks for any help -- Stan

    Do you mean the text is there in one way and then changes via some actionscript, or you edit the text in a static textfield to have that one word a different color?  For the latter, just do it.
    To do it via actionscript you would need to use htmlText property of of a dynamic textfield to make the ocean a different color.  If you wanted it to change via some actionscript from one color to another (just that word), you would have to rewrite the sentence, just add the html tags needed to color the text as desired.

  • 'Classic' textfield in CS5 - no margins on published swf

    I've got numerous static textfields containing formatted text that I have formatted in the IDE. Some paragraphs within the textfield have margins, some don't. In the IDE, all looks great. However, when published the tf seems to have a constant margin. Anyone know anyway round this without resorting to many textfields / dynamic text?

    Try this:
    DW Menu > Insert > Media > Flash Video >
    Progressive Download Video > Browse
    for .flv file > Select a skin > Hit Ok.
    Upload page and dependant files - including Scripts folder -
    to server.
    Does that help?
    --Nancy O.
    Alt-Web Design & Publishing
    www.alt-web.com
    "gina_farr" <[email protected]> wrote in
    message
    news:g8t4qm$7fa$[email protected]..
    > Hello good people--
    >
    > swf works but NO play skin. help?
    >
    > 1. Imported .mov into Flash CS3, chose skin, set
    autoplay to false
    > 2. Published movie to site root
    directory>movies>salmon -- everything is
    there
    > (skin, fla, flv, html, .js, tossed in Scripts folder
    into movies>salmon
    just in
    > case)
    > 3. Open page hero.htm in Dreamweaver CS3,
    insert>media>flash>salmon.swf
    > 4. Unchecked autoplay and loop
    > 5. Preview in browser = no play controls, so I can't
    play movie (BTW, if
    I had
    > set autoplay=true in Flash, the movie plays
    automatically, but again, no
    play
    > skin)
    > 6. Double checking, the skin file and everything else is
    present on my
    server
    > in the proper folder
    > 7. swf plays in Flash, FlvPlayer and html generated by
    Flash AND shows
    player
    > skin
    >
    > Again, the movies play fine if I select autoplay=yes in
    Flash, but still
    no
    > controls.
    >
    > My wit's end! Thanks for any help.
    >
    > Gina
    >

  • Textfield Column in Table Bug

    Hi,
    I am getting a bug when I bind a textfield to a datatable that a ObjectArrayDataProvider as the underlying datasource. When I use a static textfield the values show up fine and unqiue which they are, but if I change this to a textfield, it just keeps showing the same values as first ones selected and doesn't refresh properly.
    Regards,
    SNI.

    I also get the problem when I use a dropdown list in the table.
    the table just seems to store the first initail values for the selected value rather than the underlying actual value. I also display the description of the dropdown field in a static textfield and this works ok.
    There seems to be a problem with textfields and dropdowns binding to the actual currentrow."property" value.
    I have a div around the table to use for scrollbars. I also have another table on page.
    I will try moving child table to a new page and see what happens.
    Regards,
    SNI

  • Right justify AWT.TextField

    Hey,
    Can anybody tell me how to right justify text in an awt.texfield?
    I know I need to override the paint() method using FontMetrics Class and calculate the new position.
    But how does it work efficiently and how do I need to clear the field and set the Cursor etc.
    (Bonus answer could be, how does it work in comparison to swing/jfc :-), are there already functions to do this?)
    Thanks, Marc
    I tried something like this, but it looks pretty ugly...
    public class TFieldTest extends Frame{
    static TextField t2;
    // do something
    public static void main(String args[]) {
    // create Frame and App here
    TextField t2 = new TextField() {
    public void paint(Graphics g) {
    //super.paint(g);
    Font font = TFieldTest.t2.getFont();
    FontMetrics fm = FieldTest.t2.getFontMetrics(font);
    Dimension size = this.getSize();
    int width = fm.stringWidthTFieldTest.t2.getText());
    g.setFont(font);
    g.drawString(TFieldTest.t2.getText(),size.width-width,fm.getAscent());
    System.out.println("Overwritten Paint in TextField t2 - right justyfied");
    // do more
    }

    Well for purpose, I had 4 textfields that would show the subtotal, taxs, and grandtotal, that had to be aligned right.
    So I use label, and used the Constructor Label(String text, int alignment).
    ex:
    Label lPrix01 = new Label ("", Label.RIGHT);
    lTrans.setBounds(609,387,90,25);
    Then with paint I simply drew lines, to have the effect of a textfield
    g.setColor(white);
    g.drawLine(609,412,699,412);      //hor          Label transport
    g.drawLine(699,387,699,411);      //Ver          Label transport
    g.setColor(noir);
    g.drawLine(609,385,699,385);     //hor          Label transport
    g.drawLine(608,387,608,412);     //Ver          Label transport

  • How can I print a static text?

    As there is no instance name for a static text, how is it possible form a button to make a printJob?

    from the help docs, you can reference a static textfield using
    To create a reference to an existing static text field in ActionScript 3.0,  you can iterate over the items in the display list. For example, the following  snippet checks to see if the display list contains a static text field and  assigns the field to a variable:
    var i:uint;
    for (i = 0; i < this.numChildren; i++) {
         var displayitem:DisplayObject = this.getChildAt(i);
         if (displayitem instanceof StaticText) {
             trace("a static text field is item " + i + " on the display list");
             var myFieldLabel:StaticText = StaticText(displayitem);
             trace("and contains the text: " + myFieldLabel.text);
    but to print you need sprites to add to the printjob.  so, either print the text's parent or reparent the text for the purpose of printing.

  • Change a static TF with AS

    Hi - Is there any way to address a static textfield in a
    movieClip with AS? I want to change the color and selecability of
    the text using Actionscript (because I have about 50 of them and
    don't want to open each mc to get at the textfield.) The mc has an
    instance name but, natuarally, the textfield doesn't.
    I used static text because there are less problems with the
    font displaying on different computers. Now, down the road I have
    to make these changes. Am I screwed?
    TIA some expertise.
    JL

    I don't know if you're using flash 8... but if you want to
    get to them easily, try using the Movie Explorer (ALT-F3 in
    windows).
    Deselect everything except text.
    You can see (if you expand the branches ) content of static
    text as well as textfields
    Then if you double click the symbol icon (the owner of the
    text) it'll take you straight to editing mode for the 'owner' of
    that static text. If you go through the list in the movie explorer
    doing this it might be easier to keep track of what you've done.
    Hope that makes sense.

  • Hotlinks keep changing/breaking in textfield hyperlink.

    I'm trying to link out to other websites using a simple textfield with the text options - link, and a destination, _blank.
    It's a large document and I'm adding to it daily. The problem is, when I return to flash, and make changes in other places, the earlier links I had in place change.
    It goes from this...
    http://diario.latercera.com/2011/01/26/01/contenido/mundo/8-57352-9-egipto-registra-mayore s-protestas-contra-hosni-mubarak-en-decadas.shtml
    To this, thus breaking the link, when I haven't even worked/touched on that frame.
    http://diario.latercera.com/2011/01/26/01/contenido/mundo/8-57352-9-egipto-registra-mayore s-protestas-contra-hosni-mubarak-en-d
    Can someone please explain to me why this is happening and how to prevent it? It's incredibly frustraing, stupid.
    Here is a link to the project.
    The only links working are probably for the 14th of abril and those that aren't .shtml - (pdf's work fine and don't change.
    http://especiales.latercera.cl/especiales/2011/conflicto_medio_oriente/source/index.html
    Thanks,
    Eileen

    I'm using a static textfield. I'm not using actionscript to set the links. I'm using the input in the text properties window.
    The links stay fine as long as the document remains open. I save constantly. I can export at any point along the way, and the links will appear find in the swf. But once I close flash, certain ones truncate, so that when I reopen flash, I have to go through and repaste the link in a huge amount of these.

  • What's wrong with my program?

    Mission: A program which returns a digit based on what character you enter, and it should follow this structure:
    Digit to output / Character entered
    2 / ABC
    3 / DEF
    4 / GHI
    5 / JKL
    6 / MNO
    7 / PRS
    8 / TUV
    9 / WXY
    If you enter the letters Q, Z or any nonalphabetic letter, the program should output that an error was encountered. Must have two buttons, one for "Ok" and one for "Quit".
    I made this code so far, which gives me tons of errors I don't get much out of:
    import java.awt.*;
    import java.awt.event.*;
    public class digit
    // Define action listener for alphabetic buttons
    private static class ButtonHandler implements ActionListener
    public void actionPerformed(ActionEvent event)
    char charEntered; // Holds the character entered
    String whichButton; // Button's name
    // Get the right button
    charEntered = inputField.getText();
    whichButton = event.getActionCommand;
    // If-Else procedures, to determine which button is pressed and what action to perform
    if (whichButton.equals("ok"))
    if (charEntered.equals("A"))
    outputLabel.setText("Your digit is 2");
    else if (charEntered == D || E || F)
    outputLabel.setText("Your digit is 3");
    else if (charEntered == G || H || I)
    outputLabel.setText("Your digit is 4");
    else if (charEntered == J || K || L)
    outputLabel.setText("Your digit is 5");
    else if (charEntered == M || N || O)
    outputLabel.setText("Your digit is 6");
    else if (charEntered == P || R || S)
    outputLabel.setText("Your digit is 7");
    else if (charEntered == T || U || V)
    outputLabel.setText("Your digit is 8");
    else if (charEntered == W || X || Y)
    outputLabel.setText("Your digit is 9");
    else outputLabel.setText("An error occured.");
    private static class ButtonHandler2 implements ActionListener
    public void actionPerformed(ActionEvent event)
    dFrame.dispose();
    System.exit(0);
    private static TextField inputField; // Input field
    private static Label outputLabel; // Output Label
    private static Frame dFrame; // Frame
    public static void main(String [] args)
    // Declare alphabetic listener
    ButtonHandler operation;
    ButtonHandler2 quitoperation;
    Label entryLabel; // Label for inputfield
    Label outputLabel_label; // Label for outputfield
    Button ok; // Ok Button
    Button quit; // quit button
    operation = new Buttonhandler();
    quitoperation = new ButtonHandler2();
    // New frame
    dFrame = new Frame();
    dFrame.setLayout(new GridLayout(4,2));
    entryLabel = new Label("Enter letter here");
    outputLabel_label = new Label("The result is");
    outputLabel = new Label("0");
    // Instantiate buttons
    ok = new Button("Ok");
    quit = new Button("Quit");
    // Name the button events
    ok.setActionCommand("ok");
    quit.setActionCommand("quit");
    // Register the button listeners
    ok.addActionListener(operation);
    quit.addActionListener(operation);
    // Add interface to the Frame
    dFrame.add(entryLabel);
    dFrame.add(inputField);
    dFrame.add(outputLabel_label);
    dFrame.add(outputLabel);
    dFrame.add(ok);
    dFrame.add(quit);
    dFrame.pack();
    dFrame.show();
    dFrame.addWindowListener(new WindowAdapter()
    public void windowClosing(WindowEvent event)
    dFrame.dispose();
    System.exit(0);
    I get these errors:
    fnatte:~/inda/java/chapter6>javac digit.java
    digit.java:23: incompatible types
    found : java.lang.String
    required: char
    charEntered = inputField.getText();
    ^
    digit.java:24: cannot resolve symbol
    symbol : variable getActionCommand
    location: class java.awt.event.ActionEvent
    whichButton = event.getActionCommand;
    ^
    digit.java:31: char cannot be dereferenced
    if (charEntered.equals("A"))
    ^
    digit.java:33: cannot resolve symbol
    symbol : variable D
    location: class digit.ButtonHandler
    else if (charEntered == D || E || F)
    ^
    digit.java:33: cannot resolve symbol
    symbol : variable E
    location: class digit.ButtonHandler
    else if (charEntered == D || E || F)
    ^
    digit.java:33: cannot resolve symbol
    symbol : variable F
    location: class digit.ButtonHandler
    else if (charEntered == D || E || F)
    ^
    digit.java:35: cannot resolve symbol
    symbol : variable G
    location: class digit.ButtonHandler
    else if (charEntered == G || H || I)
    ^
    digit.java:35: cannot resolve symbol
    symbol : variable H
    location: class digit.ButtonHandler
    else if (charEntered == G || H || I)
    ^
    digit.java:35: cannot resolve symbol
    symbol : variable I
    location: class digit.ButtonHandler
    else if (charEntered == G || H || I)
    ^
    digit.java:37: cannot resolve symbol
    symbol : variable J
    location: class digit.ButtonHandler
    else if (charEntered == J || K || L)
    ^
    digit.java:37: cannot resolve symbol
    symbol : variable K
    location: class digit.ButtonHandler
    else if (charEntered == J || K || L)
    ^
    digit.java:37: cannot resolve symbol
    symbol : variable L
    location: class digit.ButtonHandler
    else if (charEntered == J || K || L)
    ^
    digit.java:39: cannot resolve symbol
    symbol : variable M
    location: class digit.ButtonHandler
    else if (charEntered == M || N || O)
    ^
    digit.java:39: cannot resolve symbol
    symbol : variable N
    location: class digit.ButtonHandler
    else if (charEntered == M || N || O)
    ^
    digit.java:39: cannot resolve symbol
    symbol : variable O
    location: class digit.ButtonHandler
    else if (charEntered == M || N || O)
    ^
    digit.java:41: cannot resolve symbol
    symbol : variable P
    location: class digit.ButtonHandler
    else if (charEntered == P || R || S)
    ^
    digit.java:41: cannot resolve symbol
    symbol : variable R
    location: class digit.ButtonHandler
    else if (charEntered == P || R || S)
    ^
    digit.java:41: cannot resolve symbol
    symbol : variable S
    location: class digit.ButtonHandler
    else if (charEntered == P || R || S)
    ^
    digit.java:43: cannot resolve symbol
    symbol : variable T
    location: class digit.ButtonHandler
    else if (charEntered == T || U || V)
    ^
    digit.java:43: cannot resolve symbol
    symbol : variable U
    location: class digit.ButtonHandler
    else if (charEntered == T || U || V)
    ^
    digit.java:43: cannot resolve symbol
    symbol : variable V
    location: class digit.ButtonHandler
    else if (charEntered == T || U || V)
    ^
    digit.java:45: cannot resolve symbol
    symbol : variable W
    location: class digit.ButtonHandler
    else if (charEntered == W || X || Y)
    ^
    digit.java:45: cannot resolve symbol
    symbol : variable X
    location: class digit.ButtonHandler
    else if (charEntered == W || X || Y)
    ^
    digit.java:45: cannot resolve symbol
    symbol : variable Y
    location: class digit.ButtonHandler
    else if (charEntered == W || X || Y)
    ^
    digit.java:79: cannot resolve symbol
    symbol : class Buttonhandler
    location: class digit
    operation = new Buttonhandler();
    ^
    25 errors
    I don't get what's wrong... I know it's something with the "equals" method.. but I can't get a grip on it.

    Hi again,
    Thanks, I'm beginning to understand the structure... charAt(0) means take character at index 0, i.e the first character.
    I also understood how the || works, and I managed to compile the thing without errors. Now my code looks like this:
    import java.awt.*;
    import java.awt.event.*;
    public class digit
        // Define action listener for alphabetic buttons
        private static class ButtonHandler implements ActionListener
         public void actionPerformed(ActionEvent event)
         char  charEntered;    // Holds the character entered
         String whichButton;  // Button's name
         // Get the right button
         charEntered = inputField.getText().charAt(0);
         whichButton = event.getActionCommand();
         // If-Else procedures, to determine which button is pressed and what action to perform
         if (whichButton.equals("ok"))
              if (charEntered == 'A' || charEntered == 'B' || charEntered ==  'C')
             outputLabel.setText("Your digit is 2");
         else if (charEntered == 'D' || charEntered == 'E' || charEntered ==  'F')
             outputLabel.setText("Your digit is 3");
         else if (charEntered == 'G' || charEntered == 'H' || charEntered ==  'I')
             outputLabel.setText("Your digit is 4");
         else if (charEntered == 'J' || charEntered == 'K' || charEntered ==  'L')
             outputLabel.setText("Your digit is 5");
         else if (charEntered == 'M' || charEntered == 'N' || charEntered ==  'O')
             outputLabel.setText("Your digit is 6");
         else if (charEntered == 'P' || charEntered == 'R' || charEntered ==  'S')
             outputLabel.setText("Your digit is 7");
         else if (charEntered == 'T' || charEntered == 'U' || charEntered ==  'V')
             outputLabel.setText("Your digit is 8");
         else if (charEntered == 'W' || charEntered == 'X' || charEntered ==  'Y')
             outputLabel.setText("Your digit is 9");
         else outputLabel.setText("An error occured.");
    private static class ButtonHandler2 implements ActionListener
        public void actionPerformed(ActionEvent event)
         dFrame.dispose();
         System.exit(0);
    private static TextField inputField; // Input field
    private static Label outputLabel; // Output Label
    private static Frame dFrame; // Frame
    public static void main(String [] args)
        // Declare alphabetic listener
        ButtonHandler operation; 
        ButtonHandler2 quitOperation;
        Label entryLabel; // Label for inputfield
        Label outputLabel_label;  // Label for outputfield
        Button ok; // Ok Button
        Button quit; // quit button
        operation = new ButtonHandler();
        quitOperation = new ButtonHandler2();
        // New frame
        dFrame = new Frame();
        dFrame.setLayout(new GridLayout(4,2));
        entryLabel = new Label("Enter letter here");
        outputLabel_label = new Label("The result is");
        outputLabel = new Label("0");
        // Instantiate buttons
        ok = new Button("Ok");
        quit = new Button("Quit");
        // Name the button events
        ok.setActionCommand("ok");
        quit.setActionCommand("quit");
        // Register the button listeners
        ok.addActionListener(operation);
        quit.addActionListener(operation);
        // Add interface to the Frame
        dFrame.add(entryLabel);
        dFrame.add(inputField);
        dFrame.add(outputLabel_label);
        dFrame.add(outputLabel);
        dFrame.add(ok);
        dFrame.add(quit);
        dFrame.pack();
        dFrame.show();
        dFrame.addWindowListener(new WindowAdapter()
             public void windowClosing(WindowEvent event)
              dFrame.dispose();
              System.exit(0);
    }And I get this error while I'm trying to run it:
    fnatte:~/inda/java/chapter6>java digit
    Exception in thread "main" java.lang.NoSuchMethodError: main

  • Java.lang.Exception:java.security.accesscontrolException:access denied

    good afternoon to all experts
    i am getting the following exception when i am going to read file
    java.lang.Exception:java.security.accesscontrolException:accessdenied(java.io.FilePermission c:\premiji.rar)
    my applet as follows
    import java.io.*;
    import java.applet.*;
    import java.awt.*;
    import java.security.*;
    import javax.crypto.Cipher;
    import javax.crypto.KeyGenerator;
    import javax.crypto.SecretKey;
    import javax.crypto.spec.*;
    import java.io.IOException;
    public class TestApp extends Applet
         public static TextField t;
         public static String key;
        public Label l;
    public  void init()
       setBackground(Color.GRAY);
       setLayout(null);
       t=new TextField("  ");
       t.setEchoChar('*');
       l=new Label("Enter ur key");
       l.setBounds(0,2,75,20);
       t.setForeground(Color.RED);
       t.setBounds(78,2,150,20);
    add(l);
       add(t);
    public static String eFile(String plainFile)throws Exception
    {String cFile="c://suri.rar";
         key=t.getText();
        byte[]raw=key.getBytes("UTF8");
        SecretKeySpec skeySpec = new SecretKeySpec(raw, "Blowfish");
        Cipher cipher = Cipher.getInstance("Blowfish");
        Cipher cipher2=Cipher.getInstance("Blowfish");
        cipher2.init(Cipher.DECRYPT_MODE,skeySpec);
        cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
        InputStream fis,dis;
        FileOutputStream fos,dos;
        fis = new FileInputStream("c://premji.rar");
        fis = new javax.crypto.CipherInputStream(fis, cipher);
        fos = new FileOutputStream(cFile);
        byte[] b = new byte[8];
        int i = fis.read(b);
        while (i != -1) {
            fos.write(b, 0, i);
            i = fis.read(b);
    dis = new FileInputStream(cFile);
    dis = new javax.crypto.CipherInputStream(dis, cipher2);
    dos=new FileOutputStream("c://madhu.rar");
    byte[] c=new byte[8];
    int j=dis.read(c);
    while(j!=-1)
         dos.write(c,0,j);
         j=dis.read(c);
       fis.close() ;
       fos.close();
       return cFile;
    }my html as follows
    html>
    <script language="JavaScript">
      function pass()
        document.myForm.uname.value=document.myApp.eFile(document.myForm.upfile.value);
    </script>
    <applet name="myApp" code="TestApp.class" archive="TestApp.jar" width=600 height=80></applet>
    <body>
    <form name="myForm" >
    Name
    <input type="text" name="uname"/>
    File
    <input type="file" name="upfile"/>
    <input type=button value="click" onClick="pass();">
    <input type="submit"/>
    </form>
    </body>
    </html>note:
    i signed my applet like
    keytool -genkey -alias sgsits -validity 365
    jarsigner TestApp.jar sgsitshave we to modify polacy file also?
    if so how & which one modify
    any suggestion would be greatly appreciated
    thanks in advance

    I assume your signature is correct.
    Signing the applet enables privileges (like file IO) whenever all the calls on the stack leading
    to the sensitive operation (in your case fis = new FileInputStream("c://premji.rar")) originate
    from the signed jar. It is not your case, as you come into the applet from javascript.
    The solution is to use AccessController.doPrivileged...(). It was designed with this situation in mind.

  • Embedding fonts

    I'm a bit confused about embedding fonts. I have Flash CS5, which the help files say automatically embeds fonts.  But then the files go on to describe how to embed fonts, as if it needs to be done.  Do I need to embed fonts for files made with Flash CS5?
    The reason I ask is that when I replace text fonts in the template I'm modifying, the font changes its appearance, even though it says it is the same font as the one that came with the template.  The font is Tahoma regular 11pt.
    I tried embedding the Tahoma font, but I'm not sure I'm using the embed process correctly.  For one thing, it doesn't seem to have many fonts you can embed. Tahoma isn't listed.  When I enter text, it looks awful -- low resolutions, bad justification, ragged edges.
    I have a MacBook Pro running leopard.
    Than you for any help you can give.
    Best -- Catherine

    I'm new enough to Flash that I don't fully understand what you wrote above. Is a static textfield one in which letters remain stationary? And by the characters actually used in the specified textfield, do you mean the characters I enter or the ones already there? In other words, if I enter letters that weren't used for that field in the template (eg, my name instead of the generic name), will they all be embedded?
    I'm not sure embedding is the problem. I think I've done it. At least, Tahoma 11pt is now one of the fonts listed in the embed menu when I bring it up.
    But the font looks awful. It is supposedly the same one as in the template, but it doesn't look the same. The size, resolution, and spacing are all bad, whereas in the template they look nice. It doesn't happen until I actually go into an element in Flash and change text. It essentially seems to "reset" the text to a new font that looks bad and doesn't space out properly.
    Thanks for any help you can give me with this!
    Best -- Cat

  • Text doesn't activate when button underneath is rolled over.

    I have 2 layers in my flash site. 1 with my nav buttons which work fine. But when I put the text in a layer above to identify the button, the button action won't activate when over the text. But when I move my cursor not on an area of the text but still over the button, it does work. Help! I got one in another part of the site to work fine, but these don't. They are set-up exactly the same as far as I can tell.

    Are you sure?  Since you use the term "classic" I assume you are using a newer version of Flash than I have.  But classically speaking... static textfields do have the selectable option (look for the "Ab" icon in the panel)

  • Urgent Help jdk 1.4.2  JWindow and Text Field

    Go thgh this code pls
    import java.awt.*;
    import javax.swing.*;
    class Test1 extends JWindow
         TextField tf;
         public Test1()
              Container contentPane = getContentPane();
              contentPane.setLayout(new FlowLayout());
              tf = new TextField(10);
              contentPane.add(tf);
    public class Test extends Test1
         public static void main(String[] args)
              Test1 t = new Test1();
              t.setSize(300,200);
              t.show();
    when the above application is compiled and run using jdk1.4 0r above the text field gets disabled. ie nothing gets entered in the text field.
    However if i extend JFrame instead of JWindow then everything is fine.
    Also note that the same code compiles and runs perfectly on 1.3.1 ie even if i extend JWindow i am able to enter text in text field.
    Pls help asap

    this works because theres an owner frame behind the window:import java.awt.*;
    import javax.swing.*;
    class Test extends JWindow
         static TextField tf;
         public Test(JFrame owner)
              super(owner);
              Container contentPane = getContentPane();
              contentPane.setLayout(new FlowLayout());
              tf = new TextField(10);
              contentPane.add(tf);
         public static void main(String[] args)
              JFrame frame = new FrameForWindow();
              Test t = new Test(frame);
              t.setSize(300, 200);
              frame.setVisible(true);
              t.setVisible(true);
    class FrameForWindow extends JFrame{}regards,
    Tim

  • Flash CS6 - Font will not render as Classic Text, only as TLF

    I've been working on a series of Flash animations in which the main font used is Helvetica Neue, which is embedded using the Font Embedding... Menu. Everything was working just fine and then yesterday the font just stopped rendering. I've spent hours thinking that it was an embedding issue-that maybe somewhere the code had been overwritten. But then I opened a new Flash file (AS3) and noticed that I couldn't get a static textfield to display text in the Helvetica Neue font. So then I unintalled my Helvetica Neue fonts and reinstalled them. I cleared my Adobe Font caches and Windows (7) Font caches. I rebooted. Still just an empty text field. Then I tried something radical. I switched the textfield from Classic Text to TLF Text. Well it turns out that TLF textfields display the Helvetica Neue Font just fine.
    So what is the deal? In this particular project TLF Text won't work because I have to publish out to Flash Player 8 as part of the project's design requirements. How do I get Helvetica Neue to start working again in Classic Text mode?

    If you are on Windows, it could be related to a recent Windows update.  Seems to have started yesterday for a lot of people.   Check out this thread (or any of the other text related threads from yesterday).
    http://forums.adobe.com/message/4916465
    The issue is related to the Windows Font Parsers.  Maybe TLF uses it's own.

Maybe you are looking for

  • How to fix out of sync devices which have used 2 apple Ids?

    I have been working with the iCloud help desk over the last couple days on this but let me explain the situation: I have 2 apple IDs.  one I use for iTunes access/purchases, etc. it happens to be my day to day email.  the other ID happens to be assoc

  • Runtime exception occurred during execution of application mapping program

    Hi all while testing intergase mapping i am getting this error-----> com/sap/xi/tf/_XI_FI_BAPI_CC_DOCUMENT_POST_REQ_MM: com.sap.aii.utilxi.misc.api.BaseRuntimeException;RuntimeException in Message-Mapping transgormation:Runtime exception during proce

  • Connecting iMac wirelessly to XBox360

    Hello All, I need to find a way to stream video that is on my local network to my XBox360 in which is connected to my Airport Extreme. I use my iMac currently to watch the video but I want to put it on my 50" TV using my XBox. Please help!!!!

  • Save weblog with source code

    Hi, Does anyone an easy way of downloading weblogs with source codes? If I select all/copy&paste into Microsoft Word 2000 (SP3), the source codes get this "nice" frame, where they are scrollable. When I save it and open it again, the source code is n

  • Order Settlement Rule

    Hi Friends, I have setup a PM Orders which collect all the maintenance and running cost  (internal service). I have assigned settlement Profile "Internal Order" with settlement rule "Mandatory for release". Now when I click settlement rule button in