Please, I want to help in correcting this code

I want to know what mistakes in this code where it gives the message (frm-41214 unable to run report)
the code
DECLARE
v_rep_id REPORT_OBJECT;
v_repjob VARCHAR2(100);
v_job_id VARCHAR2(100);
v_rep_status VARCHAR2(100);
v_reportsrvr VARCHAR2(50) := 'rep10';
v_runformat vARCHAR2(50) := 'pdf';
BEGIN
IF :date_from IS NULL and :date_to is null and :ITEM4 is null THEN
RAISE FORM_TRIGGER_FAILURE;
END IF;
v_rep_id := FIND_REPORT_OBJECT('REPORT2');
SET_REPORT_OBJECT_PROPERTY(v_rep_id, REPORT_COMM_MODE, SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(v_rep_id, REPORT_DESTYPE, CACHE);
SET_REPORT_OBJECT_PROPERTY(v_rep_id, REPORT_SERVER, v_reportsrvr);
SET_REPORT_OBJECT_PROPERTY(v_rep_id, REPORT_DESFORMAT, v_runformat);
SET_REPORT_OBJECT_PROPERTY(v_rep_id, REPORT_OTHER , 'P_date="' || TO_CHAR(:date_from, 'dd/mm/yyyy') || '" P_date1="'|| TO_CHAR(:date_to, 'dd/mm/yyyy') || '"'||'" p_no="' || :ITEM4||'" paramform=no"');
SET_REPORT_OBJECT_PROPERTY(v_rep_id, REPORT_FILENAME, 'd:\ltvisits_omayma.rdf');
v_repjob := RUN_REPORT_OBJECT(v_rep_id);
v_job_id := SUBSTR(v_repjob, LENGTH(v_reportsrvr) + 2, LENGTH(v_repjob) );
v_rep_status := REPORT_OBJECT_STATUS(v_repjob);
IF v_rep_status = 'FINISHED' THEN
WEB.SHOW_DOCUMENT('/reports/rwservlet/getjobid' || v_job_id ||'?server=' || v_reportsrvr || '', '_blank');
ELSE
message('Report failed with error message ');
END IF;
CLEAR_FORM;
END;

Hi,
You CANNOT use hardcord path in report name
SET_REPORT_OBJECT_PROPERTY(v_rep_id, REPORT_FILENAME, 'd:\ltvisits_omayma.rdf'); Remove "d:\" part from the report name and then copy your report to FORMS_PATH location.
*If answer is correct then please mark it.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Please help me correct this code

    Hi, I have to develop a Java applications that converts a positive number from base 10 to another base. It has to prompt the user to enter the number to be converted an the base to be converted into. After conversion is completed, the program should ask for another conversion. The program would run in a loop until the user would decide to end it. In case of an error entry as a base less than 2, the program should warn the user about the type of error and ask the user to re-enter the values. At the nd of the program, provide a statistic with how many conversions the user has done.
    Please look at code below, and see where i went wrong, i can't seem to figure out the formula for conversions.
    import java.io.*;
    public class Class1
         public static void main (String[] args)throws IOException
              int num=0;
              int base=0;
              int result;
              int rem;
              int arr[]=new int[20];
              int count=0;
              boolean prompt= true;
              for(int i=0; i<arr.length; i++)
                             while(prompt)
              //int i=0     ;
              String s;
              int x;
              BufferedReader aa =
                             new BufferedReader(new InputStreamReader(System.in));
              System.out.println("Enter a positive number for the conversion:");
              s = aa.readLine();
              num = Integer.parseInt(s);
                   System.out.println("Enter the base number that you want to convert your number:");
                   s=aa.readLine();
                   base = Integer.parseInt(s);
                   if(base >= 2)
                        if(num > 0)
                        {   rem= num%base;
                             num=num/base;
                             arr=rem;
                             System.out.println("The converted number is: " + arr[i]);
                             System.out.print("Would you like to go on (yes/no)?");
                             s=aa.readLine();
                             prompt= s.equalsIgnoreCase("no");
                             count++;
                             //i++;     
                        else
                             System.out.println("The number must be greater that 0, please enter an other number!!");
                   else
                        System.out.println("The base number is not the appropriate,must be greater of two!!");
                   //promt the user if he/she wants to continiue or not
                   System.out.println("You have used the conversion thingy " count " times, You Freak!");
                   System.in.read();

    Since I have already started this I will try to make the conversion work. ( usually I do not like to to other people's homework ).
    import java.io.*;
    public class Class1
         static char[] theDigits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
         public static void main (String[] args)throws IOException
              int num=0;
              int base=0;
              int result;
              int rem;
              String arr[]=new String[20];
              int count=0;
              boolean prompt= true;
              for(int i=0; i<arr.length && prompt; i++)     {
                   while(prompt) {
                        String s;
                        int x;
                        BufferedReader aa =
                        new BufferedReader(new InputStreamReader(System.in));
                        System.out.println("Enter a positive number for the conversion:");
                        s = aa.readLine();
                        num = Integer.parseInt(s);
                        System.out.println("Enter the base number that you want to convert your number:");
                        s=aa.readLine();
                        base = Integer.parseInt(s);
                        if( base >= 2 && base < 17 ) {
                             if (num > 0)     {
                                  s = "";
                                  while ( num > 0 ) {
                                       rem= num%base;
                                       s = theDigits[rem] + s;
                                       num=num/base;
                                  arr[count] = new String(s);
                                  count++;
                                  //promt the user if he/she wants to continiue or not
                                  System.out.println("The converted number is: " + s + " base " + base );
                                  System.out.print("Would you like to go on (yes/no)?");
                                  s=aa.readLine();
                                  prompt= s.equalsIgnoreCase("yes");
                             else
                                  System.out.println("The number must be greater that 0, please enter an other number!!");
                        else
                             System.out.println("The base number is not the appropriate,must be greater of two and lower of 17!!");
              System.out.println("You have used the conversion thingy " +count +" times, You Freak!");
              System.in.read();
    }kurt

  • How and where can I get intel hd 4000 graphics drivers and controll panel to 3d settings ... I want to turn off my vertical sync! please someone has to help me with this problem!

    How and where can I get intel hd 4000 graphics drivers and controll panel to 3d settings ... I want to turn off my vertical sync! please someone has to help me with this problem!

    So are there any other ways to get there, or to change options there?
    And is it plausible to use 3d vision (like nvidia its one) but than without an nvidia graphics card. for watching movie's and gaming etc.
    Thank you!

  • I have an ipod touch.  Itunes recognizes it.  However, it does not show up in "My Computer".  Please let me know how to correct this.  Thanks.

    I have an ipod touch.  Itunes recognizes it.  However, it does not show up in "My Computer".  Please let me know how to correct this.  Thanks.

    Not sure that it will show up.
    Why do you want to see it in my computer?

  • Can somebody help me with this code?

    Can anyone help me with this code? My problem is that i can't
    seem to position this form, i want to be able to center it
    vertically & horizontally in a div either using CSS or any
    other means.
    <div id="searchbar"><!--Search Bar -->
    <div id="searchcart">
    <div class="serchcartcont">
    <form action='
    http://www.romancart.com/search.asp'
    name="engine" target=searchwin id="engine">
    <input type=hidden value=????? name=storeid>
    <input type=text value='' name=searchterm>
    <input type=submit value='Go'> </form>
    </div>
    </div>
    <div class="searchcont">Search For
    Products:</div>
    </div><!-- End Search Bar -->
    Pleasssssseeeeeeee Help
    Thanks

    Hi,
    Your form is defined in a div named "serchcartcont", you can
    use attributes like position and align of the div to do what you
    want to do. But there are two more dives above this dive, you will
    have define the height width of these before you can center align
    the inner most div. If you are not defining the height & width
    then by default it decide it automatically to just fit the content
    in it.
    Hope this helps.
    Maneet
    LeXolution IT Services
    Web Development
    Company

  • Help needed in this code

    Hi guys, I need help in debugging this code I made, which is a GUI minesweeper. Its extremely buggy...I particularly need help fixing the actionListener part of the code as everytime I press a button on the GUI, an exception occurs.
    help please!
    package minesweeperGUI;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class MinesweeperGUI implements ActionListener
         //Declaration of attributes
         static int length = 0;
         JMenuItem menuItemNew = new JMenuItem();
         JRadioButtonMenuItem rbEasy = new JRadioButtonMenuItem();
         JRadioButtonMenuItem rbHard = new JRadioButtonMenuItem();
         JMenuItem menuItemExit = new JMenuItem();
         JButton buttonReset = new JButton();
         JButton buttonGrid[][] = null;
         JFrame frame = new JFrame();
         int getBombsTotal = 0;
         JLabel setBombsLabel = new JLabel();
         int a = 0;
         int b = 0;     
         //No constructor created. Uses default constructor
         //Create the menu bar
         public JMenuBar newMenuBar()
              //Sets up the menubar
              JMenuBar menuBar = new JMenuBar();
              //Sets up the Game menu with choice of new, grid size, and exit
              JMenu menu = new JMenu ("Game");
              menuBar.add (menu);
              menuItemNew = new JMenuItem ("New");
              menuItemNew.addActionListener (this);
              menu.add (menuItemNew);
              menu.addSeparator();
              //Sets up sub-menu for grid size with choice of easy and hard radio buttons
              JMenu subMenu = new JMenu ("Grid Size");
              rbEasy = new JRadioButtonMenuItem ("Easy: 5x5 grid");
              rbEasy.addActionListener (this);
              subMenu.add (rbEasy);
              rbHard = new JRadioButtonMenuItem ("Hard: 10x10 grid");
              rbHard.addActionListener (this);
              subMenu.add (rbHard);
              menu.add (subMenu);
              menu.addSeparator();
              menuItemExit = new JMenuItem ("Exit");
              menuItemExit.addActionListener (this);
              menu.add (menuItemExit);
              return menuBar;
         //Setting up of Bomb Grid
         public int [][] setGrid (int length)
              int grid[][] = null;
              grid = new int[length][length];
              for (int i = 0; i < length; i++)
                   for (int j = 0; j < length; j++)
                        grid[i][j] = ((int)Math.round(Math.random() * 10))% 2;
              return grid;     
         //Setting up of the of the graphical bomb grid
         public JButton[][] setButtonGrid (int length)
              JButton buttonGrid[][] = null;
              buttonGrid = new JButton[length][length];
              for (int i = 0; i < length; i++)
                   for (int j = 0; j < length; j++)
                        buttonGrid[i][j] = new JButton();
              return buttonGrid;
         //Setting up of a way to count the total number of bombs in the bomb grid
         public int getBombsTotal (int length, int setGrid[][])
              int bombsTotal = 0;
              for (int i = 0; i < length; i++)
                   for (int j = 0; j < length; j++)
                        if (setGrid[i][j] == 1)
                             bombsTotal += 1;
              return bombsTotal;
         //Create a label for number of bombs left
         public JLabel setBombsLabel (int getBombsTotal)
              JLabel bombsLabel = new JLabel(String.valueOf (getBombsTotal) + " Bombs Left");
              return bombsLabel;
         //Setting up a way to count the number of bombs around a button
         public String setBombs (int length, int setGrid[][], int x, int y)
              int bombs[][] = new int[length][length];
              String bombsString = null;
              for (int i = 0; i < length; i++)
                   for (int j = 0; j < length; j++)
                        if (i == 0 && j == 0)
                             bombs[i][j] = setGrid[i][j+1] + setGrid[i+1][j] +
                                  setGrid[i+1][j+1];
                        else if (i ==0 && j == (length - 1))
                             bombs[i][j] = setGrid[i][j-1] + setGrid[i+1][j-1] +
                                  setGrid[i+1][j];
                        else if (i == (length - 1) && j == 0)
                             bombs[i][j] = setGrid[i-1][j] + setGrid[i-1][j+1] +
                                  setGrid[i][j+1];
                        else if (i == (length - 1) && j == (length - 1))
                             bombs[i][j] = setGrid[i-1][j-1] + setGrid[i-1][j] +
                                  setGrid[i][j-1];
                        else if (i == 0 && j != 0 && j != (length - 1))
                             bombs[i][j] = setGrid[i][j-1] + setGrid[i][j+1] +
                                  setGrid[i+1][j-1] + setGrid[i+1][j] +
                                  setGrid[i+1][j+1];
                        else if (i == (length - 1) && j != 0 && j != (length - 1))
                             bombs[i][j] = setGrid[i-1][j-1] + setGrid[i-1][j] +
                                  setGrid[i-1][j+1] + setGrid[i][j-1] +
                                  setGrid[i][j+1];
                        else if (i != 0 && i != (length - 1) && j == 0)
                             bombs[i][j] = setGrid[i-1][j] + setGrid[i-1][j+1] +
                                  setGrid[i][j+1] + setGrid[i+1][j] +
                                  setGrid[i+1][j+1];
                        else if (i != 0 && i != (length - 1) && j == (length - 1))
                             bombs[i][j] = setGrid[i-1][j-1] + setGrid[i-1][j] +
                                  setGrid[i][j-1] + setGrid[i+1][j-1] +
                                  setGrid[i+1][j];
                        else
                             bombs[i][j] = setGrid[i-1][j-1] + setGrid[i-1][j] +
                                  setGrid[i-1][j+1] + setGrid[i][j-1] +
                                  setGrid[i][j+1] + setGrid[i+1][j-1] +
                                  setGrid[i+1][j] + setGrid[i+1][j+1];
              bombsString = String.valueOf (bombs[x][y]);
              return bombsString;
         //create the panel for the bombs label and reset button
         public JPanel newTopPanel(int length)
              int setGridNew [][] = null;
              setGridNew = new int[length][length];
              int getBombsTotalNew = 0;
              JLabel setBombsLabelNew = new JLabel();
              setGridNew = setGrid (length);
              getBombsTotalNew = getBombsTotal (length, setGridNew);
              setBombsLabelNew = setBombsLabel (getBombsTotalNew);
              JPanel topPanel = new JPanel ();
              topPanel.setLayout (new BorderLayout (50,50));
              JLabel bombsLabel = new JLabel ();
              bombsLabel = setBombsLabelNew;     
              topPanel.add (bombsLabel, BorderLayout.WEST);
              buttonReset = new JButton("Reset");
              buttonReset.addActionListener (this);
              topPanel.add (buttonReset, BorderLayout.CENTER);
              return topPanel;
         //create the panel for the play grids
         public JPanel newBottomPanel(int length)
              JButton setButtonGridNew[][] = null;
              setButtonGridNew = new JButton [length][length];
              setButtonGridNew = setButtonGrid (length);
              JPanel bottomPanel = new JPanel ();
              bottomPanel.setLayout (new GridLayout (length, length));
              buttonGrid = new JButton[length][length];          
              for (a = 0; a < length; a++)
                   for (b = 0; b < length; b++)
                        buttonGrid[a] = setButtonGridNew[a][b];
                        buttonGrid[a][b].addActionListener (this);
                        bottomPanel.add (buttonGrid[a][b]);
              return bottomPanel;
         //Overiding of abstract method actionPerformed
         public void actionPerformed(ActionEvent e)
              if (e.getSource() == menuItemNew)
                   launchFrame(length);
              else if (e.getSource() == menuItemExit)
                   frame.setVisible (false);
                   System.exit(0);
              else if (e.getSource() == rbEasy)
                   length = 5;
                   launchFrame(length);
              else if (e.getSource() == rbHard)
                   length = 10;
                   launchFrame(length);     
              else if (e.getSource() == buttonReset)
                   launchFrame(length);
              else if (e.getSource() == buttonGrid[a][b])
                   int setGridNew [][] = null;
                   setGridNew = new int[length][length];               
                   JButton bombButton [][] = null;
                   bombButton = new JButton [length][length];
                   String bombString [][] = null;
                   bombString = new String[length][length];
                   setGridNew = setGrid (length);               
                   bombString[a][b] = setBombs (length, setGridNew, a, b);
                   bombButton[a][b] = new JButton (bombString[a][b]);
                   if (setGridNew[a][b] == 0)
                        buttonGrid[a][b] = bombButton[a][b];
                        getBombsTotal--;
                        JLabel setBombsLabelNew = new JLabel();
                        setBombsLabelNew = setBombsLabel (getBombsTotal);
                   else if (setGridNew[a][b] == 1 )
                        buttonGrid[a][b] = new JButton("x");
                        JOptionPane.showMessageDialog (null, "Game Over. You hit a Bomb!");
                        System.exit(0);     
         //create the content pane
         public Container newContentPane(int length)
              JPanel topPanel = new JPanel();
              JPanel bottomPanel = new JPanel();          
              topPanel = newTopPanel(length);
              bottomPanel = newBottomPanel (length);
              JPanel contentPane = new JPanel();
              contentPane.setOpaque (true);
              contentPane.setLayout (new BorderLayout(50,50));
              contentPane.add (topPanel, BorderLayout.NORTH);
              contentPane.add (bottomPanel, BorderLayout.CENTER);
              return contentPane;
         public void launchFrame (int length)
              //Makes sure we have nice window decorations
              JFrame.setDefaultLookAndFeelDecorated(true);          
              //Sets up the top-level window     
              frame = new JFrame ("Minesweeper");
              //Exits program when the closed button is clicked
              frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
              JMenuBar menuBar = new JMenuBar();
              Container contentPane = new Container();
              menuBar = newMenuBar();
              contentPane = newContentPane (length);
              //Sets up the menu bar and content pane
              frame.setJMenuBar (menuBar);
              frame.setContentPane (contentPane);
              //Displays the window
              frame.pack();
              frame.setVisible (true);
         public static void main (String args[])
              //Default length is 5
              length = 5;
              MinesweeperGUI minesweeper = new MinesweeperGUI();
              minesweeper.launchFrame(length);

    hi, thanks. that removed the exception; although now the buttons action listener won't work :(
    here is the revised code:
    To anyone out there, can you guys run this code and help me debug it?
    I'm really desperate as this is a school project of mine and the deadline is 7 hours away. I have already been working on it for 3 days, but the program is still very buggy.
    thanks!
    /* Oliver Ian C. Wee 04-80112
    * CS12 MHRU
    * Machine Problem 2
    package minesweeperGUI;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class MinesweeperGUI implements ActionListener
         //Declaration of attributes
         static int length = 0;
         JMenuItem menuItemNew = new JMenuItem();
         JRadioButtonMenuItem rbEasy = new JRadioButtonMenuItem();
         JRadioButtonMenuItem rbHard = new JRadioButtonMenuItem();
         JMenuItem menuItemExit = new JMenuItem();
         JButton buttonReset = new JButton();
         JButton buttonGrid[][] = null;
         JFrame frame = new JFrame();
         int getBombsTotal = 0;
         JLabel setBombsLabel = new JLabel();
         int a = 0;
         int b = 0;
         //No constructor created. Uses default constructor
         //Create the menu bar
         public JMenuBar newMenuBar()
              //Sets up the menubar
              JMenuBar menuBar = new JMenuBar();
              //Sets up the Game menu with choice of new, grid size, and exit
              JMenu menu = new JMenu ("Game");
              menuBar.add (menu);
              menuItemNew = new JMenuItem ("New");
              menuItemNew.addActionListener (this);
              menu.add (menuItemNew);
              menu.addSeparator();
              //Sets up sub-menu for grid size with choice of easy and hard radio buttons
              JMenu subMenu = new JMenu ("Grid Size");
              ButtonGroup bg = new ButtonGroup();
              rbEasy = new JRadioButtonMenuItem ("Easy: 5x5 grid");
              bg.add (rbEasy);
              rbEasy.addActionListener (this);
              subMenu.add (rbEasy);
              rbHard = new JRadioButtonMenuItem ("Hard: 10x10 grid");
              bg.add (rbHard);
              rbHard.addActionListener (this);
              subMenu.add (rbHard);
              menu.add (subMenu);
              menu.addSeparator();
              menuItemExit = new JMenuItem ("Exit");
              menuItemExit.addActionListener (this);
              menu.add (menuItemExit);
              return menuBar;
         //Setting up of Bomb Grid
         public int [][] setGrid (int length)
              int grid[][] = null;
              grid = new int[length][length];
              for (int i = 0; i < length; i++)
                   for (int j = 0; j < length; j++)
                        grid[i][j] = ((int)Math.round(Math.random() * 10))% 2;
              return grid;     
         //Setting up of the of the graphical bomb grid
         public JButton[][] setButtonGrid (int length)
              JButton buttonGrid[][] = null;
              buttonGrid = new JButton[length][length];
              for (int i = 0; i < length; i++)
                   for (int j = 0; j < length; j++)
                        buttonGrid[i][j] = new JButton();
              return buttonGrid;
         //Setting up of a way to count the total number of bombs in the bomb grid
         public int getBombsTotal (int length, int setGrid[][])
              int bombsTotal = 0;
              for (int i = 0; i < length; i++)
                   for (int j = 0; j < length; j++)
                        if (setGrid[i][j] == 1)
                             bombsTotal += 1;
              return bombsTotal;
         //Create a label for number of bombs left
         public JLabel setBombsLabel (int getBombsTotal)
              JLabel bombsLabel = new JLabel("  " +String.valueOf (getBombsTotal) + " Bombs Left");
              return bombsLabel;
         //Setting up a way to count the number of bombs around a button
         public String setBombs (int length, int setGrid[][], int x, int y)
              int bombs[][] = new int[length][length];
              String bombsString = null;
              for (int i = 0; i < length; i++)
                   for (int j = 0; j < length; j++)
                        if (i == 0 && j == 0)
                             bombs[i][j] = setGrid[i][j+1] + setGrid[i+1][j] +
                                  setGrid[i+1][j+1];
                        else if (i ==0 && j == (length - 1))
                             bombs[i][j] = setGrid[i][j-1] + setGrid[i+1][j-1] +
                                  setGrid[i+1][j];
                        else if (i == (length - 1) && j == 0)
                             bombs[i][j] = setGrid[i-1][j] + setGrid[i-1][j+1] +
                                  setGrid[i][j+1];
                        else if (i == (length - 1) && j == (length - 1))
                             bombs[i][j] = setGrid[i-1][j-1] + setGrid[i-1][j] +
                                  setGrid[i][j-1];
                        else if (i == 0 && j != 0 && j != (length - 1))
                             bombs[i][j] = setGrid[i][j-1] + setGrid[i][j+1] +
                                  setGrid[i+1][j-1] + setGrid[i+1][j] +
                                  setGrid[i+1][j+1];
                        else if (i == (length - 1) && j != 0 && j != (length - 1))
                             bombs[i][j] = setGrid[i-1][j-1] + setGrid[i-1][j] +
                                  setGrid[i-1][j+1] + setGrid[i][j-1] +
                                  setGrid[i][j+1];
                        else if (i != 0 && i != (length - 1) && j == 0)
                             bombs[i][j] = setGrid[i-1][j] + setGrid[i-1][j+1] +
                                  setGrid[i][j+1] + setGrid[i+1][j] +
                                  setGrid[i+1][j+1];
                        else if (i != 0 && i != (length - 1) && j == (length - 1))
                             bombs[i][j] = setGrid[i-1][j-1] + setGrid[i-1][j] +
                                  setGrid[i][j-1] + setGrid[i+1][j-1] +
                                  setGrid[i+1][j];
                        else
                             bombs[i][j] = setGrid[i-1][j-1] + setGrid[i-1][j] +
                                  setGrid[i-1][j+1] + setGrid[i][j-1] +
                                  setGrid[i][j+1] + setGrid[i+1][j-1] +
                                  setGrid[i+1][j] + setGrid[i+1][j+1];
              bombsString = String.valueOf (bombs[x][y]);
              return bombsString;
         //create the panel for the bombs label and reset button
         public JPanel newTopPanel(int length)
              int setGridNew [][] = null;
              setGridNew = new int[length][length];
              int getBombsTotalNew = 0;
              JLabel setBombsLabelNew = new JLabel();
              setGridNew = setGrid (length);
              getBombsTotalNew = getBombsTotal (length, setGridNew);
              setBombsLabelNew = setBombsLabel (getBombsTotalNew);
              JPanel topPanel = new JPanel ();
              topPanel.setLayout (new BorderLayout (20,20));
              JLabel bombsLabel = new JLabel ();
              bombsLabel = setBombsLabelNew;     
              topPanel.add (bombsLabel, BorderLayout.WEST);
              buttonReset = new JButton("Reset");
              buttonReset.addActionListener (this);
              topPanel.add (buttonReset, BorderLayout.CENTER);
              return topPanel;
         //create the panel for the play grids
         public JPanel newBottomPanel(int length)
              JButton setButtonGridNew[][] = null;
              setButtonGridNew = new JButton [length][length];
              setButtonGridNew = setButtonGrid (length);
              JPanel bottomPanel = new JPanel ();
              bottomPanel.setLayout (new GridLayout (length, length));
              buttonGrid = new JButton[length][length];          
              for (int i = 0; i < length; i++)
                   for (int j = 0; j < length; j++)
                        buttonGrid[i][j] = setButtonGridNew[i][j];
                        buttonGrid[i][j].addActionListener (this);
                        bottomPanel.add (buttonGrid[i][j]);
              return bottomPanel;
         //Overiding of abstract method actionPerformed
         public void actionPerformed(ActionEvent e)
              if (e.getSource() == menuItemNew)
                   closeFrame();
                   launchFrame(length);
              else if (e.getSource() == menuItemExit)
                   frame.setVisible (false);
                   System.exit(0);
              else if (e.getSource() == rbEasy)
                   closeFrame();
                   length = 5;
                   launchFrame(length);
              else if (e.getSource() == rbHard)
                   closeFrame();
                   length = 10;
                   launchFrame(length);     
              else if (e.getSource() == buttonReset)
                   closeFrame();
                   launchFrame(length);
              else if (e.getSource() == buttonGrid[a])
                   int setGridNew [][] = null;
                   setGridNew = new int[length][length];               
                   JButton bombButton [][] = null;
                   bombButton = new JButton [length][length];
                   String bombString [][] = null;
                   bombString = new String[length][length];
                   setGridNew = setGrid (length);               
                   for (int i = 0; i < length; i++)
                        for (int j = 0; j < length; j++)
                             bombString[i][j] = setBombs (length, setGridNew, i, j);
                             bombButton[i][j] = new JButton (bombString[i][j]);
                   if (setGridNew[a][b] == 0)
                        buttonGrid[a][b] = bombButton[a][b];
                        getBombsTotal--;
                        JLabel setBombsLabelNew = new JLabel();
                        setBombsLabelNew = setBombsLabel (" " String.valueOf (getBombsTotal) " Bombs Left");
                   else if (setGridNew[a][b] == 1 )
                        buttonGrid[a][b] = new JButton("x");
                        JOptionPane.showMessageDialog (null, "Game Over. You hit a Bomb!");
                        System.exit(0);     
         //create the content pane
         public Container newContentPane(int length)
              JPanel topPanel = new JPanel();
              JPanel bottomPanel = new JPanel();          
              topPanel = newTopPanel(length);
              bottomPanel = newBottomPanel (length);
              JPanel contentPane = new JPanel();
              contentPane.setOpaque (true);
              contentPane.setLayout (new BorderLayout(5,5));
              contentPane.add (topPanel, BorderLayout.NORTH);
              contentPane.add (bottomPanel, BorderLayout.CENTER);
              return contentPane;
         public void closeFrame ()
              frame = new JFrame ("Minesweeper");
              frame.dispose();
         public void launchFrame (int length)
              //Makes sure we have nice window decorations
              JFrame.setDefaultLookAndFeelDecorated(true);          
              //Sets up the top-level window     
              frame = new JFrame ("Minesweeper");
              //Exits program when the closed button is clicked
              frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
              JMenuBar menuBar = new JMenuBar();
              Container contentPane = new Container();
              menuBar = newMenuBar();
              contentPane = newContentPane (length);
              //Sets up the menu bar and content pane
              frame.setJMenuBar (menuBar);
              frame.setContentPane (contentPane);
              //Displays the window
              frame.pack();
              frame.setVisible (true);
         public static void main (String args[])
              //Default length is 5
              length = 5;
              MinesweeperGUI minesweeper = new MinesweeperGUI();
              minesweeper.launchFrame(length);

  • HI ALL SINCE TWO DAYS I AM DOWNLOADING VIBER BUT I AM NOT HAVING MY ACCESS CODE AND EVERY TIME I DELETE THE APPLICATION AND DOWNLOADING IT AGAIN BUT ALWAYS THE SAME RESULT PLEASE I NEED YOUR HELP FOR THE ACCESS CODE.MY PHONE NUMBER IS 0022996969896.THANKS

    HI ALL SINCE TWO DAYS I AM DOWNLOADING VIBER BUT I AM NOT HAVING MY ACCESS CODE AND EVERY TIME I DELETE THE APPLICATION AND DOWNLOADING IT AGAIN BUT ALWAYS THE SAME RESULT PLEASE I NEED YOUR HELP FOR THE ACCESS CODE.MY PHONE NUMBER IS 0022996969896.THANKS IN ADVANCE

    try this website this should help you http://helpme.viber.com/index.php?/Knowledgebase/List/Index/1/iphone

  • I have comcast internet. Now I cannot open any of my e-mails.Please help me correct this problem. Comast is not the problem.

    I upgraded to a newer version of firefox. My ISP is Comcast.
    I tried opening up my e-mails they will not open up.I contacted Comcast ,they told me there customers have no problems opening their e-mails.Please help me with this problem asap.
    The problem started after I upgraded to the higher version.
    Thank you,
    Arnold
    My phone is: 313 882-9785

    If it's a thin 1 pixel wide vertical line it's highly likely it could be caused by a defective LCD.
    One quick basic way to check is to note the position of the line. Then go to System Preferences, Displays, and lower the resolution. If ther line moves it's on the video and the logic board or video card if fitted is likely to be defective. If the line stays in the same position it's likely to be an LCD fault. Either way to have it repaired you'll need to visit an Apple store or AASP.
    The worst offender for this problem is the Late 2006 17" iMac. FOC replacement of the LCD used to be covered by a quality program, but it's now ended.
    Steve

  • Please I want your help about Nokia 6670

    Hi freinds,
    I have nokia 6670 , by mestake and when am talking with some freind on the house phone and my mobile(6670) in my hand I recived a meesage and i want to delete it so by mestake i determine all the messages at in box and all my messages are deleted :"( , I lost avery much important messages, so
    PLEASE any one can help me to returned my messages , is there any programmes to returned
    regadrs
    me_me_na
    I WANA CRY :"(

    Only prfessional agencies (and law enforcement agencies) can dig deep into the phones file system and look at whats been deleted. The process usually damages the phone beyond repair.
    This service is not available to the public without paying a very large sum of money.
    There is no way that you can recover your deleted text messages.

  • Please someone help me with this code..

    hi, i have a big problem trying to figure out how to do this, i get this code somewhere in the net, so it's not me who code this, that's why i got this problem.
    this is a MIDlet games, something like gallaga. i like to add some features like the UP and DOWN movement and also i have a problem with his "fire", i can only shoot once after the fire image is gone in the screen, what i liked to have is even i pressed the fire button and press it again the fire will not gone, what i mean continues fire if i pressed everytime the fire button.
    i will post the code here so you can see it and give me some feedback. i need this badly, hoping to all you guys! thanks..for this forum.
    ----CODE BEGIN ---------------
    import java.io.IOException;
    import java.io.PrintStream;
    import java.util.Random;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.MIDlet;
    import javax.microedition.midlet.MIDletStateChangeException;
    import javax.microedition.rms.RecordStore;
    import javax.microedition.rms.RecordStoreException;
    public class MobileGalaga extends MIDlet
    implements CommandListener, Runnable
    class ScoreScreen extends Canvas
    public void paint(Graphics g)
    g.setColor(0xffffff);
    g.fillRect(0, 0, MobileGalaga.WIDTH, MobileGalaga.HEIGHT);
    g.setColor(0x160291);
    g.setFont(MobileGalaga.fs);
    g.drawString("Help", MobileGalaga.CENTERW, 2, 17);
    g.setColor(0);
    g.drawString("Use left/right and fire", MobileGalaga.CENTERW, 20, 17);
    g.drawString("to destory the", MobileGalaga.CENTERW, 30, 17);
    g.drawString("incoming alien MobileGalaga", MobileGalaga.CENTERW, 40, 17);
    public void keyPressed(int i)
    int j = getGameAction(i);
    if(j == 8)
    display.setCurrent(titlescreen);
    ScoreScreen()
    class TitleScreen extends Canvas
    public void paint(Graphics g)
    g.setColor(0xffffff);
    g.fillRect(0, 0, MobileGalaga.WIDTH, MobileGalaga.HEIGHT);
    g.drawImage(MobileGalaga.logoimg, MobileGalaga.CENTERW, 15, 17);
    g.setColor(0);
    g.setFont(MobileGalaga.fs);
    g.drawString("Press 5 to", MobileGalaga.CENTERW, 43, 17);
    g.drawString("see help", MobileGalaga.CENTERW, 53, 17);
    public void keyPressed(int i)
    int j = getGameAction(i);
    if(j == 8)
    display.setCurrent(scorescreen);
    TitleScreen()
    class MainScreen extends Canvas
    public void paint(Graphics g)
    offg.setColor(0xffffff);
    offg.fillRect(0, 0, MobileGalaga.WIDTH, MobileGalaga.HEIGHT);
    for(int i = 0; i < MobileGalaga.slen; i++)
    if(!MobileGalaga.dead)
    offg.drawImage(MobileGalaga.alienimg[MobileGalaga.frame[i]], MobileGalaga.x[i], MobileGalaga.y[i], 17);
    if(!MobileGalaga.playerdead)
    offg.drawImage(MobileGalaga.playerimg, MobileGalaga.px, MobileGalaga.py, 17);
    } else
    if(MobileGalaga.explodeframe < 3)
    offg.drawImage(MobileGalaga.explosionimg[MobileGalaga.explodeframe], MobileGalaga.px, MobileGalaga.py, 17);
    MobileGalaga.explodeframe++;
    if(!MobileGalaga.gameover)
    MobileGalaga.playerpause++;
    if(MobileGalaga.playerpause < 50)
    MobileGalaga.playerpause++;
    } else
    MobileGalaga.playerdead = false;
    MobileGalaga.playerpause = 0;
    MobileGalaga.px = MobileGalaga.CENTERW;
    offg.setColor(0);
    offg.drawString(MobileGalaga.scorestr, MobileGalaga.WIDTH, 0, 24);
    offg.drawImage(MobileGalaga.playerimg, 0, 0, 20);
    offg.drawString(MobileGalaga.lives + "", 12, 0, 20);
    if(MobileGalaga.laser)
    offg.drawLine(MobileGalaga.laserx, MobileGalaga.lasery, MobileGalaga.laserx, MobileGalaga.lasery + 4);
    if(MobileGalaga.showscores)
    for(int j = 0; j < 5; j++)
    if(j == MobileGalaga.rank)
    offg.setColor(0xff0000);
    else
    offg.setColor(0);
    offg.drawString((j + 1) + " .... " + getScoreStr(MobileGalaga.highscore[j]), MobileGalaga.CENTERW, 20 + j * 10, 17);
    if(MobileGalaga.showmessage)
    offg.setColor(0xff0000);
    offg.drawString(MobileGalaga.msg, MobileGalaga.CENTERW, MobileGalaga.CENTERH, 17);
    MobileGalaga.messagepause++;
    if(MobileGalaga.messagepause > 20)
    MobileGalaga.showmessage = false;
    MobileGalaga.messagepause = 0;
    if(MobileGalaga.gameover)
    MobileGalaga.showscores = true;
    else
    if(MobileGalaga.wavecomplete)
    initWave();
    g.drawImage(offimg, 0, 0, 20);
    public void keyPressed(int i)
    int j = getGameAction(i);
    if(j == 2)
    MobileGalaga.playerLeft = true;
    else
    if(j == 5)
    MobileGalaga.playerRight = true;
    else
    if(j == 8)
    fireLaser();
    public void keyReleased(int i)
    int j = getGameAction(i);
    if(j == 2)
    MobileGalaga.playerLeft = false;
    else
    if(j == 5)
    MobileGalaga.playerRight = false;
    private Image offimg;
    private Graphics offg;
    public MainScreen()
    offimg = Image.createImage(getWidth(), getHeight());
    offg = offimg.getGraphics();
    offg.setFont(MobileGalaga.fs);
    public MobileGalaga()
    rand = new Random();
    display = Display.getDisplay(this);
    mainscreen = new MainScreen();
    titlescreen = new TitleScreen();
    scorescreen = new ScoreScreen();
    WIDTH = mainscreen.getWidth();
    HEIGHT = mainscreen.getHeight();
    CENTERW = WIDTH / 2;
    CENTERH = HEIGHT / 2;
    exitCommand = new Command("Exit", 7, 1);
    playCommand = new Command("Play", 1, 1);
    quitCommand = new Command("Quit", 1, 1);
    againCommand = new Command("Again", 1, 1);
    nullCommand = new Command("", 1, 1);
    try
    alienimg[0] = Image.createImage("/alien1.png");
    alienimg[1] = Image.createImage("/alien2.png");
    explosionimg[0] = Image.createImage("/explosion1.png");
    explosionimg[1] = Image.createImage("/explosion2.png");
    explosionimg[2] = Image.createImage("/explosion3.png");
    playerimg = Image.createImage("/player.png");
    logoimg = Image.createImage("/logo.png");
    catch(IOException ioexception)
    db("Couldn't get images!");
    imgW = alienimg[0].getWidth();
    imgH = alienimg[0].getHeight();
    edgeH = imgW / 2;
    edgeV = imgH / 2;
    pimgW = playerimg.getWidth();
    pimgH = playerimg.getHeight();
    pedgeH = pimgW / 2;
    pedgeV = pimgH / 2;
    highscore = getHighScores();
    public void run()
    while(runner)
    rp();
    updatePos();
    try
    MobileGalaga _tmp = this;
    Thread.sleep(75L);
    catch(InterruptedException interruptedexception)
    db("interrupted");
    runner = false;
    MobileGalaga _tmp1 = this;
    Thread.yield();
    public void startApp()
    throws MIDletStateChangeException
    display.setCurrent(titlescreen);
    addBeginCommands(titlescreen, false);
    addBeginCommands(scorescreen, false);
    addPlayCommands(mainscreen, false);
    public void pauseApp()
    public void destroyApp(boolean flag)
    runner = false;
    th = null;
    private void rp()
    mainscreen.repaint();
    private void startGame()
    initGame();
    if(th == null)
    th = new Thread(this);
    runner = true;
    th.start();
    private void initGame()
    px = CENTERW;
    py = HEIGHT - pedgeV - pimgH;
    packcount = 0;
    lives = 3;
    score = 0;
    scorestr = "000000";
    rank = -1;
    difficulty = 400;
    wave = 1;
    initWave();
    private void initWave()
    for(int i = 0; i < slen; i++)
    frame[i] = i % 2;
    x[i] = packX[i] = sposX[i];
    y[i] = packY[i] = sposY[i];
    dx[i] = packdx = alien_dx_right;
    dy[i] = packdy = alien_dy_right;
    dxcount[i] = dycount[i] = 0;
    pmode[i] = 0;
    flying[i] = false;
    dead[i] = false;
    playerLeft = false;
    playerRight = false;
    laser = false;
    playerdead = false;
    showscores = false;
    showmessage = false;
    gameover = false;
    wavecomplete = false;
    playerpause = 0;
    messagepause = 0;
    killed = 0;
    private void updatePos()
    if(playerLeft)
    updatePlayerPos(-2);
    else
    if(playerRight)
    updatePlayerPos(2);
    fly = Math.abs(rand.nextInt() % difficulty);
    if(fly < slen && !flying[fly] && !dead[fly])
    if(x[fly] < CENTERW)
    setDX(fly, alien_dx_flyright, 2);
    setDY(fly, alien_dy_flyright, 2);
    } else
    setDX(fly, alien_dx_flyleft, 2);
    setDY(fly, alien_dy_flyleft, 2);
    flying[fly] = true;
    for(int i = 0; i < slen; i++)
    if(!dead[i])
    if(!flying[i])
    if(x[i] + edgeH + dx[i][dxcount[i]] > WIDTH)
    changePackDir(alien_dx_left, alien_dy_left);
    if((x[i] - edgeH) + dx[i][dxcount[i]] < 0)
    changePackDir(alien_dx_right, alien_dy_right);
    } else
    if(y[i] + edgeV + dy[i][dycount[i]] > HEIGHT)
    x[i] = packX[i];
    y[i] = packY[i];
    flying[i] = false;
    setDX(i, packdx, 0);
    setDY(i, packdy, 0);
    if(!playerdead && y[i] <= py + pedgeV && y[i] >= py - pedgeV && x[i] <= px + pedgeH && x[i] >= px - pedgeH)
    playerHit();
    if(laser && lasery <= y[i] + edgeV && lasery >= y[i] - edgeV && laserx <= x[i] + edgeH && laserx >= x[i] - edgeH)
    alienHit(i);
    for(int j = 0; j < slen; j++)
    if(!dead[j])
    if(framecount == 3)
    frame[j] = frame[j] + 1 < 2 ? 1 : 0;
    lastx = x[j];
    lasty = y[j];
    x[j] += dx[j][dxcount[j]];
    y[j] += dy[j][dycount[j]];
    if(pmode[j] == 0)
    dxcount[j] = dxcount[j] + 1 < dx[j].length ? dxcount[j] + 1 : 0;
    dycount[j] = dycount[j] + 1 < dy[j].length ? dycount[j] + 1 : 0;
    } else
    if(pmode[j] == 2)
    dxcount[j] = dxcount[j] + 1 < dx[j].length ? dxcount[j] + 1 : dxcount[j];
    dycount[j] = dycount[j] + 1 < dy[j].length ? dycount[j] + 1 : dycount[j];
    packX[j] += packdx[packcount];
    packY[j] += packdy[packcount];
    packcount = packcount + 1 < packlen ? packcount + 1 : 0;
    framecount = framecount + 1 < 4 ? framecount + 1 : 0;
    if(laser)
    lasery -= 6;
    if(lasery < 0)
    laser = false;
    private void setDX(int i, int ai[], int j)
    if(i == -1)
    for(int k = 0; k < slen; k++)
    if(!flying[k])
    dx[k] = ai;
    dxcount[k] = 0;
    pmode[k] = j;
    } else
    dx[i] = ai;
    dxcount[i] = 0;
    pmode[i] = j;
    private void setDY(int i, int ai[], int j)
    if(i == -1)
    for(int k = 0; k < slen; k++)
    if(!flying[k])
    dy[k] = ai;
    dycount[k] = 0;
    pmode[k] = j;
    } else
    dy[i] = ai;
    dycount[i] = 0;
    pmode[i] = j;
    private void changePackDir(int ai[], int ai1[])
    setDX(-1, ai, 0);
    setDY(-1, ai1, 0);
    packdx = ai;
    packdy = ai1;
    packcount = 0;
    private void updatePlayerPos(int i)
    plastx = px;
    px += i;
    if(px + pedgeH > WIDTH || px - pedgeH < 0)
    px = plastx;
    private void fireLaser()
    if(!laser)
    laser = true;
    laserx = px;
    lasery = py;
    private void alienHit(int i)
    if(!playerdead)
    dead[i] = true;
    laser = false;
    killed++;
    if(flying[i])
    score += 200;
    else
    score += 50;
    if(killed == slen)
    waveComplete();
    scorestr = getScoreStr(score);
    private void playerHit()
    playerdead = true;
    playerpause = 0;
    explodeframe = 0;
    lives--;
    if(lives == 0)
    gameOver();
    private void waveComplete()
    wavecomplete = true;
    difficulty -= 100;
    if(difficulty < 100)
    difficulty = 100;
    msg = "WAVE " + wave + " COMPLETE";
    messagepause = 0;
    showmessage = true;
    wave++;
    score += 1000 * wave;
    scorestr = getScoreStr(score);
    private void gameOver()
    gameover = true;
    msg = "GAME OVER";
    for(int i = 0; i < 5; i++)
    if(score < highscore[i])
    continue;
    for(int j = 4; j > i; j--)
    highscore[j] = highscore[j - 1];
    highscore[i] = score;
    rank = i;
    break;
    setHighScores();
    showmessage = true;
    messagepause = 0;
    addEndCommands(mainscreen, true);
    private void addBeginCommands(Displayable displayable, boolean flag)
    if(flag)
    removeCommands();
    displayable.addCommand(playCommand);
    displayable.addCommand(exitCommand);
    displayable.setCommandListener(this);
    private void addPlayCommands(Displayable displayable, boolean flag)
    if(flag)
    removeCommands();
    displayable.addCommand(nullCommand);
    displayable.addCommand(quitCommand);
    displayable.setCommandListener(this);
    private void addEndCommands(Displayable displayable, boolean flag)
    if(flag)
    removeCommands();
    displayable.addCommand(againCommand);
    displayable.addCommand(quitCommand);
    displayable.setCommandListener(this);
    private void removeCommands()
    Displayable displayable = display.getCurrent();
    displayable.removeCommand(nullCommand);
    displayable.removeCommand(quitCommand);
    displayable.removeCommand(againCommand);
    displayable.removeCommand(playCommand);
    displayable.removeCommand(exitCommand);
    public void commandAction(Command command, Displayable displayable)
    if(command == playCommand)
    display.setCurrent(mainscreen);
    startGame();
    if(command == quitCommand)
    runner = false;
    while(th.isAlive()) ;
    th = null;
    addPlayCommands(mainscreen, true);
    display.setCurrent(titlescreen);
    if(command == againCommand)
    runner = false;
    while(th.isAlive()) ;
    th = null;
    display.setCurrent(mainscreen);
    addPlayCommands(mainscreen, true);
    startGame();
    if(command == exitCommand)
    destroyApp(false);
    notifyDestroyed();
    private int[] getHighScores()
    int ai[] = new int[5];
    ai[0] = 5000;
    ai[1] = 4000;
    ai[2] = 3000;
    ai[3] = 2000;
    ai[4] = 1000;
    byte abyte0[][] = new byte[5][6];
    try
    hsdata = RecordStore.openRecordStore("MobileGalaga", true);
    int i = hsdata.getNumRecords();
    if(i == 0)
    for(int j = 0; j < 5; j++)
    abyte0[j] = Integer.toString(ai[j]).getBytes();
    hsdata.addRecord(abyte0[j], 0, abyte0[j].length);
    } else
    for(int k = 0; k < 5; k++)
    abyte0[k] = hsdata.getRecord(k + 1);
    String s = "";
    for(int l = 0; l < abyte0[k].length; l++)
    s = s + (char)abyte0[k][l] + "";
    ai[k] = Integer.parseInt(s);
    catch(RecordStoreException recordstoreexception)
    db("problem with initialising highscore data\n" + recordstoreexception);
    return ai;
    private void setHighScores()
    byte abyte0[][] = new byte[5][6];
    try
    hsdata = RecordStore.openRecordStore("MobileGalaga", true);
    for(int i = 0; i < 5; i++)
    abyte0[i] = Integer.toString(highscore[i]).getBytes();
    hsdata.setRecord(i + 1, abyte0[i], 0, abyte0[i].length);
    catch(RecordStoreException recordstoreexception)
    db("problem with setting highscore data\n" + recordstoreexception);
    private String getScoreStr(int i)
    templen = 6 - (i + "").length();
    tempstr = "";
    for(int j = 0; j < templen; j++)
    tempstr = tempstr + "0";
    return tempstr + i;
    public static void db(String s)
    System.out.println(s);
    public static void db(int i)
    System.out.println(i + "");
    private Display display;
    private Command exitCommand;
    private Command playCommand;
    private Command quitCommand;
    private Command againCommand;
    private Command nullCommand;
    private MainScreen mainscreen;
    private TitleScreen titlescreen;
    private ScoreScreen scorescreen;
    private static int WIDTH;
    private static int HEIGHT;
    private static int CENTERW;
    private static int CENTERH;
    private boolean runner;
    private Thread th;
    private Random rand;
    private static final int RED = 0xff0000;
    private static final int ORANGE = 0xff9100;
    private static final int YELLOW = 0xffff00;
    private static final int WHITE = 0xffffff;
    private static final int BLACK = 0;
    private static final int BLUE = 0x160291;
    private static Image alienimg[] = new Image[2];
    private static Image explosionimg[] = new Image[3];
    private static Image playerimg;
    private static Image logoimg;
    private static int imgH;
    private static int imgW;
    private static int pimgH;
    private static int pimgW;
    private static int edgeH;
    private static int edgeV;
    private static int pedgeH;
    private static int pedgeV;
    private static final Font fs = Font.getFont(64, 0, 8);
    private static final Font fl = Font.getFont(64, 1, 16);
    private static final int sposX[] = {
    16, 28, 40, 52, 4, 16, 28, 40, 52, 64,
    4, 16, 28, 40, 52, 64
    private static final int sposY[] = {
    14, 14, 14, 14, 26, 26, 26, 26, 26, 26,
    38, 38, 38, 38, 38, 38
    private static final int LOOP = 0;
    private static final int ONCE = 1;
    private static final int HOLD = 2;
    private static final int move_none[] = {
    0
    private static final int alien_dx_right[] = {
    1, 1, 1, 1, 1, 1, 1, 1
    private static final int alien_dy_right[] = {
    0, 0, 1, 1, 0, 0, -1, -1
    private static final int alien_dx_left[] = {
    -1, -1, -1, -1, -1, -1, -1, -1
    private static final int alien_dy_left[] = {
    0, 0, -1, -1, 0, 0, 1, 1
    private static final int alien_dx_flyright[] = {
    1, 1, 1, 0, -1, -1, -1, -1, -1, 0,
    1, 1, 2, 3, 4, 5, 6
    private static final int alien_dy_flyright[] = {
    0, -1, -1, -1, -1, -1, 0, 1, 1, 1,
    1, 1, 2, 3, 4, 5, 6
    private static final int alien_dx_flyleft[] = {
    -1, -1, -1, 0, 1, 1, 1, 1, 1, 0,
    -1, -1, -2, -3, -4, -5, -6
    private static final int alien_dy_flyleft[] = {
    0, -1, -1, -1, -1, -1, 0, 1, 1, 1,
    1, 1, 2, 3, 4, 5, 6
    private static final int slen;
    private static final int ailen;
    private static final int packlen;
    private static int pmode[];
    private static int x[];
    private static int y[];
    private static int dx[][];
    private static int dy[][];
    private static int dxcount[];
    private static int dycount[];
    private static int frame[];
    private static boolean flying[];
    private static boolean dead[];
    private static boolean exploding[];
    private static int lastx;
    private static int lasty;
    private static int fly;
    private static int packX[];
    private static int packY[];
    private static int packdx[];
    private static int packdy[];
    private static int packcount;
    private static int framecount = 3;
    private static int px;
    private static int py;
    private static int plastx;
    private static int score;
    private static String scorestr;
    private static int lives;
    private static int killed;
    private static boolean playerdead;
    private static int explodeframe;
    private static int playerpause;
    private static int rank;
    private static boolean playerLeft;
    private static boolean playerRight;
    private static boolean laser;
    private static int laserx;
    private static int lasery;
    private static RecordStore hsdata;
    private static int highscore[] = new int[5];
    private static boolean showmessage;
    private static boolean showscores;
    private static boolean gameover;
    private static boolean wavecomplete;
    private static int messagepause;
    private static String msg;
    private static int difficulty;
    private static int wave;
    private static String tempstr;
    private static int templen;
    static
    slen = sposX.length;
    ailen = alien_dx_flyright.length;
    packlen = alien_dx_right.length;
    pmode = new int[slen];
    x = new int[slen];
    y = new int[slen];
    dx = new int[slen][ailen];
    dy = new int[slen][ailen];
    dxcount = new int[slen];
    dycount = new int[slen];
    frame = new int[slen];
    flying = new boolean[slen];
    dead = new boolean[slen];
    exploding = new boolean[slen];
    packX = new int[slen];
    packY = new int[slen];
    packdx = new int[packlen];
    packdy = new int[packlen];
    ----END OF CODE ----------------

    hi sorry if it's too big! i hope i can explain this very well (you know i only got this code in the net), if you try to run the program in emulator, the and lunch it will it will first display the title screen and if you hit the pressed key 5 it will display help,
    so my problem is how to move UP and DOWN and also if i pressed the fire button it will continue to fire. here is the code.
    //Code for the Left,Right,UP and Down movement and also the fire
    public void keyPressed(int i)
    int j = getGameAction(i);
    if(j == 2)
    MobileGalaga.playerLeft = true; //this is ok
    else
    if(j == 5)
    MobileGalaga.playerRight = true; //this is ok
    else
    if(j==1)
    MobileGalaga.playerUp = true; //i add this only, this has a problem
    else
    if(j==6)
    MobileGalaga.playerDown = true; //i add this only, this has a problem
    else
    if(j == 8)
    fireLaser(); //for the release of fire
    //for the release of key pressed
    public void keyReleased(int i)
    int j = getGameAction(i);
    if(j == 2)
    MobileGalaga.playerLeft = false;
    else
    if(j == 5)
    MobileGalaga.playerRight = false;
    //Update the position base on key pressed
    private void updatePos()
    if(playerLeft)
    updatePlayerPos(-5);
    else
    if(playerUp)
    updatePlayerPos1(-4);
    else
    if(playerDown)
    updatePlayerPos1(4);
    else
    if(playerRight)
    updatePlayerPos(5);
    fly = Math.abs(rand.nextInt() % difficulty);
    if(fly < slen && !flying[fly] && !dead[fly])
    if(x[fly] < CENTERW)
    setDX(fly, alien_dx_flyright, 2);
    setDY(fly, alien_dy_flyright, 2);
    } else
    setDX(fly, alien_dx_flyleft, 2);
    setDY(fly, alien_dy_flyleft, 2);
    flying[fly] = true;
    for(int i = 0; i < slen; i++)
    if(!dead)
    if(!flying[i])
    if(x[i] + edgeH + dx[i][dxcount[i]] > WIDTH)
    changePackDir(alien_dx_left, alien_dy_left);
    if((x[i] - edgeH) + dx[i][dxcount[i]] < 0)
    changePackDir(alien_dx_right, alien_dy_right);
    } else
    if(y[i] + edgeV + dy[i][dycount[i]] > HEIGHT)
    x[i] = packX[i];
    y[i] = packY[i];
    flying[i] = false;
    setDX(i, packdx, 0);
    setDY(i, packdy, 0);
    if(!playerdead && y[i] <= py + pedgeV && y[i] >= py - pedgeV && x[i] <= px + pedgeH && x[i] >= px - pedgeH)
    playerHit();
    if(laser && lasery <= y[i] + edgeV && lasery >= y[i] - edgeV && laserx <= x[i] + edgeH && laserx >= x[i] - edgeH)
    alienHit(i);
    for(int j = 0; j < slen; j++)
    if(!dead[j])
    if(framecount == 3)
    frame[j] = frame[j] + 1 < 2 ? 1 : 0;
    lastx = x[j];
    lasty = y[j];
    x[j] += dx[j][dxcount[j]];
    y[j] += dy[j][dycount[j]];
    if(pmode[j] == 0)
    dxcount[j] = dxcount[j] + 1 < dx[j].length ? dxcount[j] + 1 : 0;
    dycount[j] = dycount[j] + 1 < dy[j].length ? dycount[j] + 1 : 0;
    } else
    if(pmode[j] == 2)
    dxcount[j] = dxcount[j] + 1 < dx[j].length ? dxcount[j] + 1 : dxcount[j];
    dycount[j] = dycount[j] + 1 < dy[j].length ? dycount[j] + 1 : dycount[j];
    packX[j] += packdx[packcount];
    packY[j] += packdy[packcount];
    packcount = packcount + 1 < packlen ? packcount + 1 : 0;
    framecount = framecount + 1 < 4 ? framecount + 1 : 0;
    if(laser)
    lasery -= 6;
    if(lasery < 0 )
    laser = false;
    // this will move the object UP,DOWN,Left and Right
    private void updatePlayerPos(int i)
    plastx = px;
    px += i;
    if(px + pedgeH > WIDTH || px - pedgeH < 0)
    px = plastx;
    private void updatePlayerPos1(int i)
    plastx = py;
    py += i;
    if(px + pedgeV > HEIGHT || px - pedgeV < 0)
    px = plastx;
    // This will fire, if you hit the fire button
    private void fireLaser()
    if(!laser)
    laser = true;
    laserx = px;
    lasery = py;
    sorry if it's too long i just want too explain this. if anyone like to see this and run so that you can see it also, i can send an email.
    thanks,
    alek

  • I have lost my APPLE ID security questions and APPLE does not to seem to want to help me.  This renders my iTunes account worhtless.  How do I do it?  My pass word is usable, but my security questions are to blame.  How do i fix this?

    I have misplaced my APPLE ID security questions answers and APPLE doe not seem to want to help me.  What is the procedure for resetting these secirty questions?
    With the answers, my APPLE account is useless.  HELP ME HERE!!!!

    Go to http://appleid.apple.com and select "Manage your account". Log in with your Apple ID and password, then select Password and Security from the left column.
    You need to know the answers to your existing questions to reset them. If you don't remember your answers, there may be a link on that page where you can have a reset email send to your Rescue email address. This will not appear if you have not provided a Rescue email address, and may not appear even if you did.
    If there does not seem to be any way to reset your security questions, contact iTunes Support here: http://www.apple.com/support/itunes/contact/ They will respond within a business day. Be sure to check your spam or junk mail folders for their response.

  • Please i want you help me

    please if i order internet settings fom my setting provider, i will be asked to set a configuration setting and if i try to do that it will appears on my phone that "cannot add new,accont memory full" but please i want to browse with my phone so please try and help me solve me out because am having alot space on my phone so please try and help me
    thanks.

    Presumably too you have a lot of other content on your phone which maybe you could save to a PC, or onto a memory card.
    What phone do you have?

  • Can someone pls help me with this code

    The method createScreen() creates the first screen wherein the user makes a selection if he wants all the data ,in a range or single data.The problem comes in when the user makes a selection of single.that then displays the singleScreen() method.Then the user has to input a key data like date or invoice no on the basis of which all the information for that set of data is selected.Now if the user inputs a wrong key that does not exist for the first time the program says invalid entry of data,after u click ok on the option pane it prompts him to enter the data again.But since then whenever the user inputs wrong data the program says wrong data but after displaying the singlescreen again does not wait for input from the user it again flashes the option pane with the invalid entry message.and this goes on doubling everytime the user inputs wrong data.the second wrong entry of data flashes the error message twice,the third wrong entry flashes the option pane message 4 times and so on.What actually happens is it does not wait at the singlescreen() for user to input data ,it straight goes into displaying the JOptionPane message for wrong data entry so we have to click the optiion pane twice,four times and so on.
    Can someone pls help me with this!!!!!!!!!
    import java.util.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.text.*;
    import java.util.*;
    public class MainMenu extends JFrame implements ActionListener,ItemListener{
    //class     
         FileReaderDemo1 fd=new FileReaderDemo1();
         FileReaderDemo1 fr;
         Swing1Win sw;
    //primary
         int monthkey=1,counter=0;
         boolean flag=false,splitflag=false;
         String selection,monthselection,dateselection="01",yearselection="00",s,searchcriteria="By Date",datekey,smonthkey,invoiceno;
    //arrays
         String singlesearcharray[];
         String[] monthlist={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"};
         String[] datelist=new String[31];
         String[] yearlist=new String[100];
         String[] searchlist={"By Date","By Invoiceno"};
    //collection
         Hashtable allinvoicesdata=new Hashtable();
         Vector data=new Vector();
         Enumeration keydata;
    //components
         JButton next=new JButton("NEXT>>");
         JComboBox month,date,year,search;
         JLabel bydate,byinvno,trial;
         JTextField yeartext,invtext;
         JPanel panel1,panel2,panel3,panel4;
         JRadioButton single,range,all;
         ButtonGroup group;
         JButton select=new JButton("SELECT");
    //frame and layout declarations
         JFrame jf;
         Container con;
         GridBagLayout gridbag=new GridBagLayout();
         GridBagConstraints gc=new GridBagConstraints();
    //constructor
         MainMenu(){
              jf=new JFrame();
              con=getContentPane();
              con.setLayout(null);
              fr=new FileReaderDemo1();
              createScreen();
              setSize(500,250);
              setLocation(250,250);
              setVisible(true);
    //This is thefirst screen displayed
         public void createScreen(){
              group=new ButtonGroup();
              single=new JRadioButton("SINGLE");
              range=new JRadioButton("RANGE");
              all=new JRadioButton("ALL");
              search=new JComboBox(searchlist);
              group.add(single);
              group.add(range);
              group.add(all);
              single.setBounds(100,50,100,20);
              search.setBounds(200,50,100,20);
              range.setBounds(100,90,100,20);
              all.setBounds(100,130,100,20);
              select.setBounds(200,200,100,20);
              con.add(single);
              con.add(search);
              con.add(range);
              con.add(all);
              con.add(select);
              search.setEnabled(false);
              single.addItemListener(this);
              search.addActionListener(new MyActionListener());     
              range.addItemListener(this);
              all.addItemListener(this);
              select.addActionListener(this);
         public class MyActionListener implements ActionListener{
              public void actionPerformed(ActionEvent a){
                   JComboBox cb=(JComboBox)a.getSource();
                   if(a.getSource().equals(month))
                        monthkey=((cb.getSelectedIndex())+1);
                   if(a.getSource().equals(date)){
                        dateselection=(String)cb.getSelectedItem();
                   if(a.getSource().equals(year))
                        yearselection=(String)cb.getSelectedItem();
                   if(a.getSource().equals(search)){
                        searchcriteria=(String)cb.getSelectedItem();
         public void itemStateChanged(ItemEvent ie){
              if(ie.getItem()==single){
                   selection="single";     
                   search.setEnabled(true);
              else if (ie.getItem()==all){
                   selection="all";
                   search.setEnabled(false);
              else if (ie.getItem()==range){
                   search.setEnabled(false);
         public void actionPerformed(ActionEvent ae){          
              if(ae.getSource().equals(select))
                        if(selection.equals("single")){
                             singleScreen();
                        if(selection.equals("all"))
                             sw=new Swing1Win();
              if(ae.getSource().equals(next)){
                   if(monthkey<9)
                        smonthkey="0"+monthkey;
                   System.out.println(smonthkey+"/"+dateselection+"/"+yearselection+"it prints this");
                   allinvoicesdata=fr.read(searchcriteria);
                   if (searchcriteria.equals("By Date")){
                        System.out.println("it goes in this");
                        singleinvoice(smonthkey+"/"+dateselection+"/"+yearselection);
                   else if (searchcriteria.equals("By Invoiceno")){
                        invoiceno=invtext.getText();
                        singleinvoice(invoiceno);
                   if (flag == false){
                        System.out.println("flag is false");
                        singleScreen();
                   else{
                   System.out.println("its in here");
                   singlesearcharray=new String[data.size()];
                   data.copyInto(singlesearcharray);
                   sw=new Swing1Win(singlesearcharray);
         public void singleinvoice(String searchdata){
              keydata=allinvoicesdata.keys();
              while(keydata.hasMoreElements()){
                        s=(String)keydata.nextElement();
                        if(s.equals(searchdata)){
                             System.out.println(s);
                             flag=true;
                             break;
              if (flag==true){
                   System.out.println("vector found");
                   System.exit(0);
                   data= ((Vector)(allinvoicesdata.get(s)));
              else{
                   JOptionPane.showMessageDialog(jf,"Invalid entry of date : choose again");     
         public void singleScreen(){
              System.out.println("its at the start");
              con.removeAll();
              SwingUtilities.updateComponentTreeUI(con);
              con.setLayout(null);
              counter=0;
              panel2=new JPanel(gridbag);
              bydate=new JLabel("By Date : ");
              byinvno=new JLabel("By Invoice No : ");
              dateComboBox();
              invtext=new JTextField(6);
              gc.gridx=0;
              gc.gridy=0;
              gc.gridwidth=1;
              gridbag.setConstraints(month,gc);
              panel2.add(month);
              gc.gridx=1;
              gc.gridy=0;
              gridbag.setConstraints(date,gc);
              panel2.add(date);
              gc.gridx=2;
              gc.gridy=0;
              gc.gridwidth=1;
              gridbag.setConstraints(year,gc);
              panel2.add(year);
              bydate.setBounds(100,30,60,20);
              con.add(bydate);
              panel2.setBounds(170,30,200,30);
              con.add(panel2);
              byinvno.setBounds(100,70,100,20);
              invtext.setBounds(200,70,50,20);
              con.add(byinvno);
              con.add(invtext);
              next.setBounds(300,200,100,20);
              con.add(next);
              if (searchcriteria.equals("By Invoiceno")){
                   month.setEnabled(false);
                   date.setEnabled(false);
                   year.setEnabled(false);
              else if(searchcriteria.equals("By Date")){
                   byinvno.setEnabled(false);
                   invtext.setEnabled(false);
              monthkey=1;
              dateselection="01";
              yearselection="00";
              month.addActionListener(new MyActionListener());
              date.addActionListener(new MyActionListener());
              year.addActionListener(new MyActionListener());
              next.addActionListener(this);
              invtext.addKeyListener(new KeyAdapter(){
                   public void keyTyped(KeyEvent ke){
                        char c=ke.getKeyChar();
                        if ((c == KeyEvent.VK_BACK_SPACE) ||(c == KeyEvent.VK_DELETE)){
                             System.out.println(counter+"before");
                             counter--;               
                             System.out.println(counter+"after");
                        else
                             counter++;
                        if(counter>6){
                             System.out.println(counter);
                             counter--;
                             ke.consume();
                        else                    
                        if(!((Character.isDigit(c) || (c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)))){
                             getToolkit().beep();
                             counter--;     
                             JOptionPane.showMessageDialog(null,"please enter numerical value");
                             ke.consume();
              System.out.println("its at the end");
         public void dateComboBox(){          
              for (int counter=0,day=01;day<=31;counter++,day++)
                   if(day<=9)
                        datelist[counter]="0"+String.valueOf(day);
                   else
                        datelist[counter]=String.valueOf(day);
              for(int counter=0,yr=00;yr<=99;yr++,counter++)
                   if(yr<=9)
                        yearlist[counter]="0"+String.valueOf(yr);
                   else
                        yearlist[counter]=String.valueOf(yr);
              month=new JComboBox(monthlist);
              date=new JComboBox(datelist);
              year=new JComboBox(yearlist);
         public static void main(String[] args){
              MainMenu mm=new MainMenu();
         public class WindowHandler extends WindowAdapter{
              public void windowClosing(WindowEvent we){
                   jf.dispose();
                   System.exit(0);
    }     

    Hi,
    I had a similar problem with a message dialog. Don't know if it is a bug, I was in a hurry and had no time to search the bug database... I found a solution by using keyPressed() and keyReleased() instead of keyTyped():
       private boolean pressed = false;
       public void keyPressed(KeyEvent e) {
          pressed = true;
       public void keyReleased(KeyEvent e) {
          if (!pressed) {
             e.consume();
             return;
          // Here you can test whatever key you want
       //...I don't know if it will help you, but it worked for me.
    Regards.

  • HT201372 used this to make a bootable copy for a new hard drive installation. copied the install find but gave error code 110 when making the disk bootable.. Any help in what this code is

    Used createinstallmedis to make a copy of the Mavericks app for use in a new hard drive install.. Copied find but gave error code 110 and failed to make the flash drive bootable.. Any help in what errror code means?

    Did you partition and format the flash drive first? See the following:
    Make Your Own Mavericks, Mountain/Lion Installer
    After downloading the installer you must first save the Install Mac OS X application. After the installer downloads DO NOT click on the Install button. Go to your Applications folder and make a copy of the installer. Move the copy into your Downloads folder. Now you can click on the Install button. You must do this because the installer deletes itself automatically when it finishes installing.
       2. Get a USB flash drive that is at least 8 GBs. Prep this flash drive as follows:
    Open Disk Utility in your Utilities folder.
    After DU loads select your flash drive (this is the entry with the mfgr.'s ID and size) from the leftside list. Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Set the format type to Mac OS Extended (Journaled.) Click on the Options button, set the partition scheme to GUID then click on the OK button. Click on the Partition button and wait until the process has completed.
    Select the volume you just created (this is the sub-entry under the drive entry) from the left side list.
    Click on the Erase tab in the DU main window.
    Set the format type to Mac OS Extended (Journaled.) Click on the Options button, check the button for Zero Data and click on OK to return to the Erase window.
    Click on the Erase button. The format process can take up to an hour depending upon the flash drive size.
    Make your own Mavericks flash drive installer using the Mavericks tool:
    Mavericks has its own built-in installer maker you use via the Terminal:
    You will need a freshly partitioned and formatted USB flash drive with at least 8GBs. Leave the name of the flash drive at the system default, "Untitled." Do not change this name. Open the Terminal in the Utilities folder. Copy this command line after the prompt in the Terminal's window:
    sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ Mavericks.app --nointeraction
    Press RETURN. Enter your admin password when prompted. It will not be echoed to the screen so be careful to enter it correctly. Press RETURN, again.
    Wait for the process to complete which will take quite some time.

  • Pls help to correct my code

    Hai Java Guru.
    I am new to java , i got an exception while i practicing on packages. I did a program which have two packages and one of them have a function, And i access this function from other packages , and i got a run time error like NoclassDeffound error ...........
    pls help me to correct this error ............... Thank u

    jvk1980 wrote:
    wats the access specifier of the functions ?Doesn't matter, yet. Its either classpath, or he hasn't imported the class.

Maybe you are looking for

  • Moving music from one computer to another using an iPod?

    Thing is I want to buy a new laptop soon, and I'd like to move my music from my old computer to the new one, but I'd like to use my iPod 160GB as a hard disk to transport it, I've copied my music and video files along with other important data into f

  • An error occurred while processing your request. How do I fix this?

    I have been getting this error for the website: www.poptropica.com and i tried different browsers but no difference i cleared my history, my cookie and my cached files it is still there, and when it goes away and i try logging in there is a pop up wh

  • How can I get a new iChat account?

    I cannot use my current iChat because I did not listen to the instructions and I was wondering if I can restart iChat and start over from the beginning.

  • Breaking WAR into multiple similar wars

    I have a web app which authenticates a user before serving any of the urls. I have a requirement to have multiple wars deployed instead of single war for the same application and these multiple wars represent the same application but with different s

  • Will audition 1.5 work on windows 8?

    has anyone ever used auditon 1.5?