Help, java programs cannot display properly

Hello,
I installed redhat 8.0 on my laptop ( Compaq Presario 1120, video
card ATI Mobility Radeon 9000, not sure, how to check?). Then I
installed j2re1.4.1, but when I run java program, it can only show
the frame, just a frame.
In the terminal, it gave the following message:
java.lang.InternalError: not implemented yet
at sun.awt.X11SurfaceData.getRaster(X11SurfaceData.java:155)
at sun.java2d.loops.OpaqueCopyAnyToArgb.Blit(CustomComponent.java:67)
at sun.java2d.loops.GraphicsPrimitive.convertFrom(GraphicsPrimitive.java:451)
at sun.java2d.loops.MaskBlit$General.MaskBlit(MaskBlit.java:186)
at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:749)
at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2803)
at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2793)
If somebody knows what's the problem, please tell me, thanks!

I had exactly the same problem with RH8.
I fixed the swing problem by editing /etc/X11/XF86Config and adding
the following line in the Screen section:
DefaultFbBpp     32I restarted X (telinit 3; telinit 5 from root) and SwingSet2
ran perfectly without any console exceptions.
Thanks to Juergen Kreileder, Blackdown Java-Linux Team for this

Similar Messages

  • Error message "This program cannot display the webpage when uploading images to Cafe Press

    I have had a Café Press shop for five years and except for sometimes being slow, no problems uploading images. Now, suddenly for 3 days I get the message "This program cannot display the webpage
    Most likely causes:
    • You are not connected to the Internet.
    • The website is encountering problems.
    • There might be a typing error in the address.
    What you can try:
    Check your Internet connection. Try visiting another website to make sure you are connected.
    Retype the address."
    I got the messsage about half way through the uploading of an image. People suggested using "firefox" instead of IE so I now get a similar error message from Firefox. I signed in, clicked on the image I wanted to upload and hit "upload" and get message as follows:
    Server not found
    Firefox can't find the server at members.cafepress.com.
    * Check the address for typing errors such as
    ww.example.com instead of
    [url=http://www.example.com]www.example.com[/url]
    * If you are unable to load any pages, check your computer's network connection.
    * If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.
    None of this makes sense because I WAS connected to the internet (obviously) or I wouldn't have been able to sign in, go to my media basket, browse for the image and click "upload" and watch as the progress bar showed percentage of upload such as 20%, etc. and even went to 100% at times before giving me the error message. Plus I couldn't make a typing error since I wasn't typing anything but uploading an image. Any suggestions?
    Whatever your suggestion, I need step by step instructions as I am totally computer illiterate. I don't even know what a "proxy" is and don't know if I have a "firewall" as the message suggests. I have "Comodo" security and am using Windows XP.
    I contacted CP which was no help at all. All they did was tell me to clear my cache which I do after every session. Thanks
    Nancy
    http://www.cafepress.com/calendarflr

    Sounds like your desktop application is in fact running from
    a server. CHMs were identified as a security risk by Microsoft and
    are best suited to the user's PC.
    Click
    here for more information.

  • Window 8.1 Chinese character cannot display properly in a game even though I have downloaded and install all chinese language packs

    Hi,
    The operation system for my computer is Window 8.1. I am currently trying to install a chinese game. Even though I have downloaded and install all the chinese language pack, I have even set the regional language locale to chinese (similified / traditional),
    the chinese characters will not display properly in the game. Some people told me i need to set the locale to Chinese PRC, but I am not sure where to download this PRC language pack for window 8.1 (as I only have chinese simplified and chinese traditional).
    I would greatly appreciate if someone can give me a hand in solving this problem. Thank you for your help in advance. 

    Hi,
    The operation system for my computer is Window 8.1. I am currently trying to install a chinese game. Even though I have downloaded and install all the chinese language pack, I have even set the regional language locale to chinese (similified / traditional),
    the chinese characters will not display properly in the game. Some people told me i need to set the locale to Chinese PRC, but I am not sure where to download this PRC language pack for window 8.1 (as I only have chinese simplified and chinese traditional).
    I would greatly appreciate if someone can give me a hand in solving this problem. Thank you for your help in advance. 
    Hi,
    Please open Region, under administrative -> Language for non-Unicode programs: choose Chinese.
    Kate Li
    TechNet Community Support

  • Creating a  a java Program which Displays a POP UP in a JSF Web Page!

    Hi Folks,
    I wrote a java program which checks the user credentials against the Active Directory, and if it exists displays a URL (of Web Application) with useri nfo filled automatically in the page deployed on Tomcat ver 6.x.
    Now My Problem is just that I have a Pop up in the User Login page which has 3 buttons and according to that the Logic ,Navigation flows. Earlier i was just filling the info directly from Active Directory and Landed into the User Info Page. But now the functionality has changed so I have to modify it. I am not able to find how to Display the Pop up. in that page.
    If anybody can help me with that I would be really greatful.
    Thanks in Advance ,
    Somil

    Thank you for the quick response George. I guess a better way communicate what I need to accomplish is "how"
    I went to the toolbar on the right, then "javascript", then "Document Java Scripts". That opened a window that had me name the script, then add it, then put in the scripting (see below). I do not know how to "place it in a document-level JavaScript (outside of a function definition) or in the initial page's Page Open event."
    This is the script I am attempting to use.
    var message = "When you have completed filling out the Tax Organizer, click on the purple "SUBMIT" button at the top of the page. This will automaticall submit your Tax Organizer for you. Be sure to print a copy for your files"
    app.alert(msg,3);
    If you could provide some step by steps that would be super.
    I am wanting this pop-up box to open and the client will have to then click on the "ok" button to make it dissapear so that they can then fill out the PDF.
    The "Submit" button is auto created for me when I choose to distribute the form, I am unaware of any way to move it.
    I feel that my issue is a elementary one, I am currently working through the Adobe Classroom in a Book lessons as all my acrobat skills have been self taught.

  • QuickTime movies cannot display properly, refresh doesn't work propely for html files on hard disk, opening a new tab doesn't work

    Hi!
    I have tried Firefox V4 (but have since reused V3.6.16). The following problems were found:
    a. Cannot display the controls used for QuickTime movies.
    b. The refresh button doesn't function at all if the html files reside on the hard disk. I do this because I need to test the appearance of the web page before uploading to the server.
    This problem also exists for v3.6.14 to v3.6.16
    c. When opening a new tab, it doesn't work. Instead, it will open another instance of the browser. By right, it has to open the web page on the same instance of the browser.
    This is my feedback.
    Thanks!!!!! :)

    I had some advice to try recording QT audio and adding to the slide.  Now, when recording to Quicktime, it does embed it, but in recording the presentation, it either doubles up the audio giving a strange echo or does the same thing if you ever edit the presentation.
    The problem Keynote has is that the sound and image content are not locked together which causes out of sync errors. This is why many users choose video editing applications when using sound in the presentations, as they have both image and audio tracks to sync sound properly together.
    Start a new presentation to remove the previous sound recording, Keynote is holding onto the other sound files.
    Add the graphic items to each slide and one sound file to each slide for the voice over
    1 - In Inspector > Transitions;  use start transitions automatically and set each transitions delay to the duration of the individual sound file.
    2 - In QT export, set Fixed Timing and delete the value in the duration box, QT will then use the custom timings for each individual slide.
    This procedure does work exactly as needed, Iv used this for nearly 6 years using 4 different versions of Keynote.

  • Help regarding program to display even numbers

    plz send me a program to display even numbers from 1 to 100.

    DATA : VAL TYPE I.
    DO 100 TIMES.
    COMPUTE VAL = SY-INDEX MOD 2.
    IF VAL EQ 0.
    WRITE : / 'Even NOs are' , SY-INDEX.
    *ELSE.
    *WRITE
    ENDIF.
    ENDDO.
    REGARDS
    SHIBA DUTTA

  • Please help, java program terminating unexpectedly without reason

    ok, so I have a project I'm working on, here's its description:
    Create a new project named FML_Pig where F is your first initial, M is your middle initial, and L is your last initial. For example, if your name is Alfred Edward Neuman then you would name your project AEN_Pig. If necessary, add a new Java file to this project named FML_Pig.
    Add a java file to the project named FML_Dice.
    Design and implement a Dice class as follows. The Dice class has 2 twenty‑sided dice with numbers on the faces (1 � 20) and 2 twenty-six-sided dice with letters on the faces (a � z).
    import java.util.Random;
    public class FML_Dice
    private static Random gen = new Random();
    private final static int NUM_SIDES = 20;
    private int die1, die2, numSnakeEyes, numVowels, totalPoints;
    private char die3, die4;
    Part 1
    Add a rollDice() method to your FML_Dice class that sets die1 and die2 to a random number between 1 and 20 and it sets die3 and die4 to a random character between �a� and �z�.
    Helpful Hint:
    dice3 = (char)(�a� + gen.nextInt(26)); // sets dice3 to a random char between �a� and �z�.
    Part 2
    Write a constructor that sets die1 and die2 to a random number between 1 and 20 and it sets die3 and die4 to a random character. Your constructor can simply call rollDice() to do this. It should also initialize numSnakeEyes, numVowels, and totalPoints to 0 (after you roll the dice).
    Part 3
    Write methods getDie1(), getDie2(), getDie3(), and getDie4() that returns the value of the respective die. Write a method numSnakes() that returns the number of snake eyes that have been rolled. Write a method numVowels() that returns the number of vowels that have been rolled. Write a method totalPts() that returns the totalPoints.
    Part 4
    Write a toString() method that overwrites the default toString() method. It should return a String representation of the value of all 4 die. For example, 17 2 h w.
    Part 5
    Write a method updateTotals that updates numVowels, numSnakeEyes, and totalPoints based on the current values of die1, die2, die3, and die4. numVowels should be incremented by 1 if either die3 or die4 are a vowel. However, if both die3 and die4 are vowels, the totalPoints should be reset to 0 and numVowels should be reset to 0 also. numSnakeEyes should be incremented by 1 if either die1 or die2 have a face value of 1 (this is not truly a snake eyes, but it gives better odds for the game). totalPoints should be incremented by the sum of die1 and die2 multiplied by (numSnakeEyes + 1).
    Part 6
    Write a main program (use the one in FML_Pig.java) that plays a game of Pig. In this game, two people play against each other. Player1 begins by rolling the dice. The total of die1 and die2 is added to his total score. Player1�s turn continues until he/she rolls a total of 4 vowels then the turn switches to Player2. Whenever a turn switches to the other player, the number of vowels is reset to zero. Also, if at any time both die3 and die4 are vowels, the total score is reset to 0 and the turn switches to the other player. (So the turn switches to the other player whenever the total number of vowels reaches four or there are two vowels rolled at the same time.)
    If a player rolls snakeeyes (for our game, snakeeyes occurs whenever either of the dice have a face value of one � in reality, both die1 and die2 should have a face value of one but then snakeeyes would occur only once every 400 rolls), then his point values are doubled from that point on (all future rolls for the rest of the game, point values for this player are doubled). When a player rolls snake eyes again, point values are tripled for that roll and all future rolls. (Three snake eyes, quadrupled, etc.)
    (continued on the next page)
    Be sure to display the results of the roll for each turn.
    First player to get to 2000 points wins the game and gets to oink like a pig.
    Note: Both players need their own set of Dice since the Dice keeps track of the totalPoints, the number of snake eyes rolled so far, and the number of vowels rolled so far for that particular player. You can do this simply by declaring it that way in the main program:
    Dice player1 = new Dice();
    Dice player2 = new Dice();
    You may add additional methods and instance variables to the class as needed. For example, I would probably write a private helper method isVowel() that is passed a char argument ch and returns true if ch is a vowel.
    Also, you can have the computer play for both player 1 and player 2. Simply loop it until somebody wins. Print out the result for each turn including who rolled the dice (player 1 or player 2), what they rolled, how many snakeeyes do they have, how many points did they get for this turn, and how many total points do they have.
    When you are completely finished, hand in just the java files (FLM_Dice & FLM_Pig). If you happened to write any other classes, make sure they are named with the FML format, and turn these in as well. I do not need EasyReader or p.
    Oink! Oink!
    This pig won the game --------->
    so here's my code:
    this isn't my code but is required to compile my code: // package com.skylit.io;
    import java.io.*;
    *  @author Gary Litvin
    *  @version 1.2, 5/30/02
    *  Written as part of
    *  <i>Java Methods: An Introduction to Object-Oriented Programming</i>
    *  (Skylight Publishing 2001, ISBN 0-9654853-7-4)
    *   and
    *  <i>Java Methods AB: Data Structures</i>
    *  (Skylight Publishing 2003, ISBN 0-9654853-1-5)
    *  EasyReader provides simple methods for reading the console and
    *  for opening and reading text files.  All exceptions are handled
    *  inside the class and are hidden from the user.
    *  <xmp>
    *  Example:
    *  =======
    *  EasyReader console = new EasyReader();
    *  System.out.print("Enter input file name: ");
    *  String fileName = console.readLine();
    *  EasyReader inFile = new EasyReader(fileName);
    *  if (inFile.bad())
    *    System.err.println("Can't open " + fileName);
    *    System.exit(1);
    *  String firstLine = inFile.readLine();
    *  if (!inFile.eof())   // or:  if (firstLine != null)
    *    System.out.println("The first line is : " + firstLine);
    *  System.out.print("Enter the maximum number of integers to read: ");
    *  int maxCount = console.readInt();
    *  int k, count = 0;
    *  while (count < maxCount && !inFile.eof())
    *    k = inFile.readInt();
    *    if (!inFile.eof())
    *      // process or store this number
    *      count++;
    *  inFile.close();    // optional
    *  System.out.println(count + " numbers read");
    *  </xmp>
    public class EasyReader
      protected String myFileName;
      protected BufferedReader myInFile;
      protected int myErrorFlags = 0;
      protected static final int OPENERROR = 0x0001;
      protected static final int CLOSEERROR = 0x0002;
      protected static final int READERROR = 0x0004;
      protected static final int EOF = 0x0100;
       *  Constructor.  Prepares console (System.in) for reading
      public EasyReader()
        myFileName = null;
        myErrorFlags = 0;
        myInFile = new BufferedReader(
                                new InputStreamReader(System.in), 128);
       *  Constructor.  opens a file for reading
       *  @param fileName the name or pathname of the file
      public EasyReader(String fileName)
        myFileName = fileName;
        myErrorFlags = 0;
        try
          myInFile = new BufferedReader(new FileReader(fileName), 1024);
        catch (FileNotFoundException e)
          myErrorFlags |= OPENERROR;
          myFileName = null;
       *  Closes the file
      public void close()
        if (myFileName == null)
          return;
        try
          myInFile.close();
        catch (IOException e)
          System.err.println("Error closing " + myFileName + "\n");
          myErrorFlags |= CLOSEERROR;
       *  Checks the status of the file
       *  @return true if en error occurred opening or reading the file,
       *  false otherwise
      public boolean bad()
        return myErrorFlags != 0;
       *  Checks the EOF status of the file
       *  @return true if EOF was encountered in the previous read
       *  operation, false otherwise
      public boolean eof()
        return (myErrorFlags & EOF) != 0;
      private boolean ready() throws IOException
        return myFileName == null || myInFile.ready();
       *  Reads the next character from a file (any character including
       *  a space or a newline character).
       *  @return character read or <code>null</code> character
       *  (Unicode 0) if trying to read beyond the EOF
      public char readChar()
        char ch = '\u0000';
        try
          if (ready())
             ch = (char)myInFile.read();
        catch (IOException e)
          if (myFileName != null)
            System.err.println("Error reading " + myFileName + "\n");
          myErrorFlags |= READERROR;
        if (ch == '\u0000')
          myErrorFlags |= EOF;
        return ch;
       *  Reads from the current position in the file up to and including
       *  the next newline character.  The newline character is thrown away
       *  @return the read string (excluding the newline character) or
       *  null if trying to read beyond the EOF
      public String readLine()
        String s = null;
        try
          s = myInFile.readLine();
        catch (IOException e)
          if (myFileName != null)
            System.err.println("Error reading " + myFileName + "\n");
          myErrorFlags |= READERROR;
        if (s == null)
          myErrorFlags |= EOF;
        return s;
       *  Skips whitespace and reads the next word (a string of consecutive
       *  non-whitespace characters (up to but excluding the next space,
       *  newline, etc.)
       *  @return the read string or null if trying to read beyond the EOF
      public String readWord()
        StringBuffer buffer = new StringBuffer(128);
        char ch = ' ';
        int count = 0;
        String s = null;
        try
          while (ready() && Character.isWhitespace(ch))
            ch = (char)myInFile.read();
          while (ready() && !Character.isWhitespace(ch))
            count++;
            buffer.append(ch);
            myInFile.mark(1);
            ch = (char)myInFile.read();
          if (count > 0)
            myInFile.reset();
            s = buffer.toString();
          else
            myErrorFlags |= EOF;
        catch (IOException e)
          if (myFileName != null)
            System.err.println("Error reading " + myFileName + "\n");
          myErrorFlags |= READERROR;
        return s;
       *  Reads the next integer (without validating its format)
       *  @return the integer read or 0 if trying to read beyond the EOF
      public int readInt()
        String s = readWord();
        if (s != null)
          return Integer.parseInt(s);
        else
          return 0;
       *  Reads the next double (without validating its format)
       *  @return the number read or 0 if trying to read beyond the EOF
      public double readDouble()
        String s = readWord();
        if (s != null)
          return Double.parseDouble(s);
          // in Java 1, use: return Double.valueOf(s).doubleValue();
        else
          return 0.0;
    }same with this:
    public class p
         public static void l(String S)
          { System.out.println(S);}
         public static void o(String S)
          {System.out.print(S);}
         public static void l(int i)
          { System.out.println(i);}
         public static void o(int i)
          {System.out.print(i);}
         public static void l(boolean b)
          { System.out.println(b);}
         public static void o(boolean b)
          {System.out.print(b);}
        public static void l(char c)
          { System.out.println(c);}
         public static void o(char c)
          {System.out.print(c);}     
         public static void l(double d)
          { System.out.println(d);}
         public static void o(double d)
          {System.out.print(d);} 
        public static void l(Object obj)
          { System.out.println(obj.toString());}
         public static void o(Object obj)
          {System.out.print(obj.toString());}
         public static void l()
          {System.out.println();}
    }       here's my code:
    import java.util.*;
    public class JMM_Pig
         public static void main(String[] args)
              int winner=0;
              int pts=0;
                   JMM_Dice player1=new JMM_Dice();
                   JMM_Dice player2=new JMM_Dice();
                   p.l("Player 1 rolls the dice...");
                   player1.rollDice();
                   player1.updateTotals();
                   boolean loop=true;
                   while(loop)
                   while(player1.numVowels()<=4)
                        p.l("Player 1 continues his turn...");
                        player1.rollDice();
                        player1.updateTotals();
                        p.l("Player 1 rolled a "+player1.getDie1()+" and a "+player1.getDie2()+" and a '"+player1.getDie3()+"' and a '"+player1.getDie4()+"'");
                        p.l("Player 1 rolled "+player1.currvowels()+" vowels.");
                        p.l("Player 1 has "+player1.totalvowels()+" total vowels.");
                        //if(player1.getMagic()==1)
                        //player1.totalPoints=(player1.totalPoints+player1.getDie1()+player1.getDie2())*player1.mult;
                        //pts=(player1.totalPts()+player1.getDie1()+player1.getDie2())*player1.getMult();
                        //player1.setTpts(pts);
                        //if(player1.getMagic()!=1)
                             //player1.totalPoints=player1.totalPoints+player1.getDie1()+player1.getDie2();
                        //pts=player1.totalPts()+player1.getDie1()+player1.getDie2();
                        //player1.setTpts(pts);
                        p.l("Player 1 has "+player1.numSnakes()+" snake eyes.");
                        p.l("Player 1 earned "+player1.ptsreturn()+" points this turn.");
                        p.l("Player 1 has "+player1.totalPts()+" total points.");
                        pts=0;
                        if(player1.totalPts()>=2000)
                             winner=1;
                             player1.setNv(4);loop=false;
                        if((player1.isavowel(player1.getadice()))&&player1.isavowel(player1.getadice2()))
                             player1.setTpts(0);player1.setNv(0);player1.setNv(4);
                   p.l("Player 1's turn has ended...");
                   player1.setNv(0);
                   p.l("Player 2 rolls the dice...");
                   player2.rollDice();
                   player2.setTpts(player2.totalPts()+player2.getDie1()+player2.getDie2());
                   while(player2.numVowels()<=4)
                        p.l("Player 2 continues his turn...");
                        player2.rollDice();
                        player2.updateTotals();
                        p.l("Player 2 rolled a "+player2.getDie1()+" and a "+player2.getDie2()+" and a '"+player2.getDie3()+"' and a '"+player2.getDie4()+"'");
                        p.l("Player 2 rolled "+player2.currvowels()+" vowels.");
                        p.l("Player 2 has "+player2.totalvowels()+" total vowels.");
                        //if(player1.getMagic()==1)
                        //player1.totalPoints=(player1.totalPoints+player1.getDie1()+player1.getDie2())*player1.mult;
                        //pts=(player1.totalPts()+player1.getDie1()+player1.getDie2())*player1.getMult();
                        //player1.setTpts(pts);
                        //if(player1.getMagic()!=1)
                             //player1.totalPoints=player1.totalPoints+player1.getDie1()+player1.getDie2();
                        //pts=player1.totalPts()+player1.getDie1()+player1.getDie2();
                        //player1.setTpts(pts);
                        p.l("Player 2 has "+player2.numSnakes()+" snake eyes.");
                        p.l("Player 2 earned "+player2.ptsreturn()+" points this turn.");
                        p.l("Player 2 has "+player2.totalPts()+" total points.");
                        pts=0;
                        if(player2.totalPts()>=2000)
                             winner=2;
                             player2.setNv(4);loop=false;
                        if((player2.isavowel(player2.getadice()))&&player2.isavowel(player2.getadice2()))
                             player2.setTpts(0);player2.setNv(0);player2.setNv(4);
                   p.l("Player 2's turn has ended...");
                   player2.setNv(0);
                   if(player1.totalPts()>=2000)
                        winner=1;
                        loop=false;
                   if(player2.totalPts()>=2000)
                        winner=2;
                        loop=false;
                   }  //main loop
                   if(winner==1)
                        p.l("It ended with the following statistics...");
                        p.l("Player 1's score was: "+player1.totalPts()+" and Player 2's score was: "+player2.totalPts());
                        p.l("Player 1 had: "+player1.numSnakes()+" snake eye(s) and Player 2 had: "+player2.numSnakes()+" snake eye(s)");
                        p.l("Player 1 wins, oink oink!");
                   if(winner==2)
                        p.l("It ended with the following statistics...");
                        p.l("Player 1's score was: "+player1.totalPts()+" and Player 2's score was: "+player2.totalPts());
                        p.l("Player 1 had: "+player1.numSnakes()+" snake eye(s) and Player 2 had: "+player2.numSnakes()+" snake eye(s)");
                        p.l("Player 2 wins, oink oink!");
    and dice class:
    import java.util.*;
    public class JMM_Dice {
         private static Random gen = new Random();
        private final static int NUM_SIDES = 21;
        private int die1, die2, numSnakeEyes, numVowels, totalPoints;
        private char die3, die4;
        private int dice=0;
           //dice=
           private int dice2=0;
           //dice2=;
           private String adice="";
           //adice=;
           private String adice2="";
           //adice2;
           private int magic=0;
           private int mult=0;
           private int currvowels=0;
           private int totalvowels=0;
      public static EasyReader key = new EasyReader();
      public JMM_Dice()
          dice=0;dice2=0;
           String alpha="abcdefghijklmnopqrstuvwxyz";
          adice="";adice2="";
           rollDice();
           numSnakeEyes=0;numVowels=0;totalPoints=0;
      public void setTpts(int tpts)
           this.totalPoints=tpts;
      public void setNv(int nv)
           this.numVowels=nv;
      public int getDie1()
           return dice;
      public int getDie2()
           return dice2;
      public String getDie3()
           return adice;
      public String getDie4()
           return adice2;
      public int numSnakes()
           return numSnakeEyes;
      public void setSnakes(int s)
           this.numSnakeEyes=s;
      public String getadice()
           return this.adice;
      public String getadice2()
           return this.adice2;
      public int numVowels()
           return numVowels;
      public int getMagic()
           return this.magic;
      public int getNv()
           return this.numVowels;
      public void setMagic(int mag)
           this.magic=mag;
      public int getMult()
           return this.mult;
      public void setMult(int m)
           this.mult=m;
      public int totalPts()
           return totalPoints;
      public String toString()
           return dice+""+dice2+""+adice+""+adice2;
      public boolean isavowel(String str)
           if(str.equals("a")||str.equals("e")||str.equals("i")||str.equals("o")||str.equals("u"))
                return true;
           else
                return false;
      public int ptsreturn()
           return dice+dice2;
      public int currvowels()
           int tmp=currvowels;
           currvowels=0;
           return tmp;
      public int totalvowels()
           return numVowels;
      public void updateTotals()
           if(adice.equalsIgnoreCase("a")||adice.equalsIgnoreCase("e")||adice.equalsIgnoreCase("i")||adice.equalsIgnoreCase("o")||adice.equalsIgnoreCase("u")||adice2.equalsIgnoreCase("a")||adice2.equalsIgnoreCase("e")||adice2.equalsIgnoreCase("i")||adice2.equalsIgnoreCase("o")||adice2.equalsIgnoreCase("u"))
                numVowels++;currvowels++;
           if((isavowel(adice))&&isavowel(adice2))
                totalPoints=0;numVowels=0;
           if(dice==1||dice2==1)
                numSnakeEyes++;
           int fd=dice;
           int sd=dice2;
           int sum=fd+sd;
           totalPoints+=sum*(numSnakeEyes+1);
      public void rollDice()
           dice=gen.nextInt(20)+1;
           dice2=gen.nextInt(20)+1;
           String alpha="abcdefghijklmnopqrstuvwxyz";
           adice=String.valueOf(alpha.charAt(gen.nextInt(26)));
           adice2=String.valueOf(alpha.charAt(gen.nextInt(26)));
      public static void sleep (int wait)
      {     long timeToQuit = System.currentTimeMillis() + wait;
           while (System.currentTimeMillis() < timeToQuit)
                ;   // take no action
    }the program works fine except it's supposed to terminate when one of the two AIs get a score of 2000, right now it terminates no matter what score the AIs get and no matter what I've tried to do it keeps doing that...can someone please tell me why it's terminating so oddly? Thanks! :)

    Here's how my code works in a nutshell, the main program starts with the boolean loop=true;
                   while(loop)
                   {then comes the loops for the two AIs, first the player 1 AI goes with this loop: while(player1.numVowels()<=4)
                   {there the player 1 roles the dice and it keeps going until player 1 gets a total of 2000 points at which time this is supposed to execute: if(player1.totalPts()>=2000)
                             winner=1;
                             player1.setNv(4);loop=false;
                        }, player1.setNv(4); sets numVowels to 4 so that the inner loop exits, loop=false exits the other loop and winner=1; specifies that player 1 won which is used outside of the loops here: if(winner==1)
                        p.l("It ended with the following statistics...");
                        p.l("Player 1's score was: "+player1.totalPts()+" and Player 2's score was: "+player2.totalPts());
                        p.l("Player 1 had: "+player1.numSnakes()+" snake eye(s) and Player 2 had: "+player2.numSnakes()+" snake eye(s)");
                        p.l("Player 1 wins, oink oink!");
                   if(winner==2)
                        p.l("It ended with the following statistics...");
                        p.l("Player 1's score was: "+player1.totalPts()+" and Player 2's score was: "+player2.totalPts());
                        p.l("Player 1 had: "+player1.numSnakes()+" snake eye(s) and Player 2 had: "+player2.numSnakes()+" snake eye(s)");
                        p.l("Player 2 wins, oink oink!");
                   } the same thing happens for player 2 if player 1 didn't already get 2000 points...but the if statement despite everything pointing to the variables containing the right values don't seem to be working, as shown by the example program output I posted it just ends at any random number...hopefully this helps make figuring out what's wrong easier :) ...so can anyone please help me out? thanks! :)

  • Help T_T - Program not compiling properly

    I'm trying to add a short animation to the source file for a
    game that was built by an outside studio. Unfortunately, I can't
    seem to get the program to compile correctly: I get tons of errors,
    graphics dont diplay properly, etc. I thought perhaps I had just
    messed something up with my codes and animations, but even if i try
    to compile the original unedited file as a control test, i get the
    same problems. I have all the external files, scripts, etc.
    None of our scripters are in-house, so there's no one I can
    ask about this. I know just enough actionscript to prevent Flash
    from exploding into a gooey mass (which is how I ended up getting
    tasked with this), but basically my knowledge of flash is limited
    to it as an animation program so I'm not really sure if theres some
    kind of settings I need to change, specifically need to export as
    an .exe (shouldn't be, since the game runs as a .swf), or what.
    I know i'm not providing a whole lot of information about the
    problem, but thats because I'm not really sure what info is
    relevant. Let me know if there's anything people need from me and
    I'll get it to you.
    Thanks!

    Just a had brief look, but shouldn't it be:public class TempConversion extends JFrameIf you post code it is a good idea to use the formatting tags:
    http://forum.java.sun.com/help.jspa?sec=formatting
    Basically the idea is you put [code] at the start of your code and [/code]
    at the end.

  • Create the dbf file with java, but cannot display the data with VF

    Dear all,
    i create a dbf file with some java packages, this file can be opened and display all of the data with excel, but just can show the data structure and no any data when i open it with VF, how to solve it?

    Hi, I have got same problem as you. My application generates a DBF file from a resultset. In MS Excel it looks pretty good - all data, but when I try to open same DBF file with Fox or MS Access, I always see ONLY header(column names), but NO data! I don't know why?! The application generates this file using JDBF classes (version 1.0). I guess, maybe it is caused by the size of this file. The DBF file had 18 columns and over 32000 rows.
    Did you find the cause? I'll be grateful for help.

  • Linux or Java? :Cannot display non english characters

    hi,
    i am trying to implement a GUI that supports both turkish and english. user can switch between them on the fly.
    public class SampleGUI {
    JButton trTranslate = new JButton(); /* Button, to translate into turkish */
    /* Label text will be translated */
    JLabel label = new JLable("Text to Be Translated!");
    trTranslate.addActionListener (new ActionListener(){
    void ActionPerformed(ActionEvent e){
    String language="tr";
    String country="TR";
    Locale currentLocale;
    ResourceBundle messages;
    currentLocale = new Locale(language, country);
    messages = ResourceBundle.getBundle("TranslateMessages",currentLocale);
    /* get from properties file turkish match of "TextTranslate "*/
    label.setText(messages.getString("TextToTranslate"));
    Finally, my problem is my application does not display non english chracaters like "� &#351; � &#287; � i" in GUI after triggering translation.However, if i do not use ResourceBundle and instead assign directly the turkish match for that label (i.e. label.setText("&#351;&#351;&#351;&#351;&#351;")), GUI successfully displays turkish characters. what may be the problem?
    ps : i am using redhat linux8.0, j2sdk1.4.1. current locale = "tr_TR.UTF-8". in /etc/sysconfig/keyboard , keyTable = "trq". There seems no problem for me as i can input and output
    turkish characters. OS supports this. Also jvm gets the current encoding from OS.It seems as if there is a problem in reading properties file in inappropriate encoding.
    thanx for dedicating ur time and effort,
    hELin

    CROSSPOST: http://forum.java.sun.com/thread.jsp?forum=31&thread=373338&tstart=0&trange=30

  • Help me! Cannot display menubar

    Hello,everyone!
    There is a Menubar.
    The Menubar has 100 menuitems.
    Problem:Can not display all menuitems.
    Do MenuBar's SubMenu has Scroller?
    Sample:
    <mx:MenuBar id="myMenuBar" width="450" height="50" >
    <mx:dataProvider>
    <mx:XML>
    <menuitem label="menuitem 1"/>
    <menuitem label="menuitem 1"/>
    </mx:XML>
    </mx:dataProvider>
    </mx:MenuBar>

    You may try the "flexlib" from Google:
    http://code.google.com/p/flexlib/wiki/ComponentList

  • My Java application cannot exit properly when Windows Vista log off

    When I run my Java swing application and show to user (only in active window state), log off / shutdown process of Windows OS will be interrupted by dialog box, mentioned that the process is blocking by my Java application. The dialog box has 2 buttons, 1st button, log off / shutdown now, 2nd button, cancel log off / shutdown. If I click cancel button, terrible thing happen!!! My Java application hang there with CPU usage 90 something....
    I using 1.5 and having above mentioned problem. But when I using 1.6, no dialog box is pop up, my machine can go log off / shutdown as my expectation.
    Any expert know how to solve this?
    ps: due to my library constraints, i have to using 1.5.
    Thanks in advance

    The GeForce 8800 GS in an iMac is equivalent to a GeForce 8800M GTS in a PC.
    Forceware driver 178.15 offers support for GeForce 8800M GTS:
    http://laptopvideo2go.com/forum/index.php?showtopic=20927
    Run that exe in Vista 64x, and then select the INF file from the Device Manager manual driver update instructions instead of picking from the list (which doesn't contain GeForce 8800 GS).
    GF 8800 GS does NOT equal GF 8800 GT. Very different cards.
    http://en.wikipedia.org/wiki/GeForce8_series#8800GS
    See http://discussions.apple.com/thread.jspa?messageID=8281574#8281574 for more info.
    I didn't figure out how to get this to work on 32-bit Vista.

  • Message window, "This program cannot display the web page", and there's no close button to delete it. The only way I can get rid of it is to re-start my computer. Any ideas?

    Can I send you the jpeg of the message window, please? It's the best way I can describe it. There's a blue-coloured circular icon with a white "i" within the circle, but, as I said, no close button at any of the window corners

    Hard restart..  While the phone is powered in, hold the power and home button.   Hold them down and keep them held down.  the phone will eventually shut itself off and reopen.  keep held down till you see the appl elogo, then release.  This will not delete anything off your phone, it will just force all apps to stop their current process.  If you just turn the phone on and off, it will just pick up where it left off.  Good luck

  • Web Dynpro-layout preview-Error-IE cannot display-service in SICF activated

    Hello,
    By starting a view in web dynpro framework, i have the error in tab layout "page cannot be displayed" from IE.
    Before i make the change in the DNS and system32/../etc, the layout was displayed, but the web dynpro application cannot be started.
    Now after those configurations and activation of services in SICF, i can start the web application only with firefox and not internet exploer, and, that internet explorer is preconfigured for the layout preview, i recieve all times the eror "cannot display" when i start a view in the layout tab.
    1. How can i change settings so that view can be displayed in layout after i actived the (hope the suitables i.e. view designer) services in SICF - Default_host...
    2. Is it possible to change IE to firefox as main browser for layout tab.
    Note: For virtual domain i
    1. add dns "domain.com" in the DNS
    2. add in system32/etc/host file to "127.0.0.1 localhost",    "10.10.0.10 sysserv.domain.com"
    3. and trough tr. rz10 in the instance profil input the icm/.... ....domain.com
    Through this three steps i could get the web dynpro application started,
    but from the other side, the layout preview do not display the view again
    and just send error the message: "THIS PROGRAM CANNOT DISPLAY THE WEBPAGE"
    Many thanks for helping
    arnaud
    Edited by: Arnaud on Jul 15, 2010 4:36 PM
    Edited by: Arnaud on Jul 15, 2010 8:31 PM

    Hi,
    The string is not correctly formed ( a quote and a concatenation ) :
    Your url :
    v_url:=nvl(v_rep_port,'http://'||v_rep_HOST ||':'||v_rep_port||')||'/reports/rwservlet/getjobid'||substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server='||v_rep_svr;
    The Correction :
    v_url:=nvl(v_rep_port,'http://'||v_rep_HOST ||':'||v_rep_port)||'/reports/rwservlet/getjobid'||substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server='||v_rep_svr;
    Hope it helps
    Mohamed Dadi

  • Java program stopped running when using JVMPI

    Hi!
    I'm writting a very simple profiler using JVMPI. I intended to pause/continue it by sending signal, like kill -SIGUSR2 PID, to it, but whenever I did this, the java program that ran with the profiler stopped running, however the profiler kept running properly.
    Here's the code of the simple profiler and the testing java program.
    //myprofiler.cc
    #include <jvmpi.h>
    #include <pthread.h>
    #include <stdio.h>
    #include <signal.h>
    void sig_handler_pause(int);
    static JVMPI_Interface *jvmpi_interface;
    void notifyEvent(JVMPI_Event *event) {
    switch(event->event_type) {
    case JVMPI_EVENT_CLASS_LOAD:
    fprintf(stderr, "myprofiler> Class Load : %s\n", event->u.class_load.class_name);
    break;
    case JVMPI_EVENT_OBJECT_ALLOC:
    fprintf(stderr, "myprofiler>object alloc \n");
    break;
    extern "C" {
    JNIEXPORT jint JNICALL JVM_OnLoad(JavaVM jvm, char options, void *reserved) {
    fprintf(stderr, "myprofiler> initializing ..... \n");
    // get jvmpi interface pointer
    if ((jvm->GetEnv((void **)&jvmpi_interface, JVMPI_VERSION_1)) < 0) {
    fprintf(stderr, "myprofiler> error in obtaining jvmpi interface pointer\n");
    return JNI_ERR;
    // initialize jvmpi interface
    jvmpi_interface->NotifyEvent = notifyEvent;
    // enabling class load event notification
    jvmpi_interface->EnableEvent(JVMPI_EVENT_CLASS_LOAD, NULL);
    fprintf(stderr, "myprofiler> .... ok \n\n");
    signal(SIGUSR2,sig_handler_pause);
    return JNI_OK;
    void start(){
              fprintf(stderr,"start...\n");
         jvmpi_interface->EnableEvent(JVMPI_EVENT_OBJECT_ALLOC, NULL);
    jvmpi_interface->EnableEvent(JVMPI_EVENT_CLASS_LOAD,NULL);
    void pause(){
              fprintf(stderr,"pause...\n");
              jvmpi_interface->DisableEvent(JVMPI_EVENT_OBJECT_ALLOC, NULL);
    jvmpi_interface->DisableEvent(JVMPI_EVENT_CLASS_LOAD,NULL);
    int status=0;
    void sig_handler_pause(int sig){
         if(status == 0){
              start();
              status = 1;
         else if(status == 1){
              pause();
              status = 0;
    //Test.java
    public class Test {
    public static void main(String[] args) {
         try {
                        int i = 0;
    while(true)
                             Thread.sleep(1000);
                        System.out.println(i++);
              catch (Exception e) {
                        e.printStackTrace();
    Here're some notes:
    1)If I didn't call
    jvmpi_interface->EnableEvent(JVMPI_EVENT_OBJECT_ALLOC, NULL);
    in "start()" function, the java program Test ran properly after I sent signal to the process by using kill command in an command line;
    or
    2) If I delete "Thread.sleep(1000)" in Test.java, then whether I call
    jvmpi_interface->EnableEvent(JVMPI_EVENT_OBJECT_ALLOC, NULL);
    in "start()" or not, the Test program ran properly after I sent signal to the process.
    It seems to be a thread dead lock, but I'm not sure. Can any body help?Thanks very much.

    I should strongly recommend moving from JVMPI to JVM TI if you can. The reason is that JVMPI has been deprecated since 5.0 and can not be used with Java SE 6 and newer.
    Anyway, the issue you have may be due to the signal you are using. I'm not sure which operating system this is but on Linux the USR2 signal is used for the suspend/resume implementation. Have you looked at the Troubleshooting Guide or the Signal Chaining page for details on how signals are used and how to chain handlers? Another idea is to remove the signal handling code implementation and to use the data dump event. This is supported by both JVMPI and JVM TI so that you get an event (via the QUIT signal).

Maybe you are looking for

  • Signature not working after latest update

    I've been using Adobe Reader (on Mac) to write professional reports for years with no problems until the latest update. Now I can't add and save any documents with my signature. Even tried Echosign to no avail. Before the last update, I used to place

  • Now that iBiz is not compatible with Mavericks, what type of accounting software works with ical.

    I use iBiz for a small business that tracks appointments and expenses.  I don't need payroll.  Most importantly, I need the software to communicate with calendar since I have to keep my partner's calendar up to date and he uses calendar on his iphone

  • Where can i get an older version of Download Helper?

    Since the Download Helper no longer works with the new Browser/Add-on Update & it doesn't appear that it will be fixed anytime soon, where could I get and install an older version of the Download Helper?

  • Fail to download X virtual frame buffer (xvfb)

    I went to the page http://otn.oracle.com/products/ias/ias_utilities.html#xvfb in hope to download the oracle prebuilt Xvfb for solaris, when I click on any one of the three xvfb download items, it keeps returning a error page "The page cannot be disp

  • Down arrow key unreliable in iPhoto 11

    Hi there, I've just noticed that sometimes, when I'm in an event looking at photos in thumbnail view, my down arrow stop working. The up, right and left arrows work just fine, but the down one simply stops responding. In certain events, I can move do