HELP witha SIDE SCROLLING GAME PLEASE!!!!!!!!!

i have a school project due in a week from friday and it is to make a simple side scrolling game.
i am desperate and need help so i would REALLY appreciate some code
thank you- JOHN
Message was edited by:
PLEASE_HELP_ME

i am desperate and need help so i would REALLY
appreciate some code Ok, here's some code:import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
import javax.swing.*;
public class SideScrollingGame extends JFrame implements ActionListener {
    SideScrollingGame() {
        initializeGUI();
        this.setVisible(true);
    public void actionPerformed(ActionEvent ae) {
        if (ae.getSource() == jbDone) {
            this.setVisible(false);
            this.dispose();
    private void initializeGUI() {
        int width = 400;
        int height = 300;
        this.setSize(width, height);
        this.getContentPane().setLayout(new BorderLayout());
        this.setTitle(String.valueOf(title));
        Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
        Random rand = new Random();
        int x = rand.nextInt(d.width - width);
        int y = rand.nextInt(d.height - height);
        this.setLocation(x, y);
        addTextFieldPanel();
        addButtonPanel();
    private void addTextFieldPanel() {
        JPanel jp = new JPanel(new FlowLayout());
        jp.add(new JLabel(String.valueOf(title)));
        jp.add(jtfInput);
        this.getContentPane().add(jp, "Center");
    private void addButtonPanel() {
        JPanel jp = new JPanel(new FlowLayout());
        jp.add(jbDone);
        jbDone.addActionListener(this);
        this.getContentPane().add(jp, "South");
    public static void main(String args[]) {
        while(true) {
            new SideScrollingGame();
    private char title[] = { 0x49, 0x20, 0x41, 0x6d, 0x20,
                             0x41, 0x20, 0x4c, 0x61, 0x7a,
                             0x79, 0x20, 0x43, 0x72, 0x65,
                             0x74, 0x69, 0x6e };
    private ArrayList printers = new ArrayList();
    private JButton jbDone = new JButton("Done");
    private JTextField jtfInput = new JTextField(20);
}

Similar Messages

  • Need help with " Number guessing game " please?

    This is what teacher requires us to do for this assignment:
    Write a program that plays a simple number guessing game. In this game the user will think of a number and the program will do the guessing. After each guess from the program, the user will either indicate that the guess is correct (by typing �c�), or that the next guess should be higher (by typing �h�), or that it should be lower (by typing �l�). Here is a sample output for a game. In this particular game the user thinks of the number 30:
    $java GuessingGameProgram
    Guess a number between 0 and 100
    Is it 50? (h/l/c): l
    Is it 25? (h/l/c): h
    Is it 37? (h/l/c): l
    Is it 31? (h/l/c): l
    Is it 28? (h/l/c): h
    Is it 29? (h/l/c): h
    Is it 30? (h/l/c): c
    Thank you for playing.
    $
    This program is implementing a binary search algorithm, dividing the range of possible values in half with each guess. You can implement any algorithm that you want, but, all things being equal, binary search is the best algorithm.
    Write the program so that the functionality is split between two classes: GuessingGameProgram, and NumberGuesser.
    GuessingGameProgram will only be used for its main function. It should instantiate a NumberGuesser, and it will be responsible for the loop that notifies the user of the next guess, reads the �h�, �l�, or �c� from the user, and sends an appropriate message to the number guesser accordingly.
    The guesses themselves should all be generated by the NumberGuesser class. Here is a diagram of the members and methods for the class. Notice that the members are unspecified. Feel free to give your NumberGuesser class any members (which we have also been calling fields, or instance variables) that you find useful. Make them all private.
    NumberGuesser
    NumberGuesser(int upperLimit, int lowerLimit)
    int guess()
    void higher()
    void lower()
    The constructor should take two integer arguments, a lower and upper bound for the guesses. In your program the constructor will be called with bounds of 0 and 100.
    The guess method should return the same value if it is called more than once without intervening calls to the lower or higher methods. The class should only change its guess when it receives a message indicating that its next guess should be higher or lower.
    Enjoy. Focus your attention on the NumberGuesser class. It is more interesting than the GuessingGameProgram class because it is a general-purpose class, potentially useful to anybody who is writing a number guessing game. Imagine, for instance, that a few weeks from now you are asked to write a number guessing game with a graphical Java Applet front end. If you NumberGuesser class is well written, you may be able to reuse it without any modifications.
    I'm new to JAVA and I'm set with my 2nd homework where I'm so confused. I know how to do something of this source in C language, but I'm a bit confused with Java. This is the code me and my classmate worked on, I know it's not 100% of what teacher asked, but is there any way possibly you guys could help me? I wrote this program if the game is played less then 10 times, thought I would then re-create a program without it, but now I'm confused, and my class book has nothing about this :( and I'm so confused and lost, can you please help? And out teacher told us that it's due the end of this week :( wish I knew what to do. Thank you so so much.
    Here's the code:
    import java.text.*;
    import java.io.*;
    class GuessingGame
    public static void main( String[] args ) throws IOException
    BufferedReader stdin = new BufferedReader(new InputStreamReader( System.in ) );
    int guess = 0, limit = 9, x = 0, n, a = 0 ;
    double val = 0 ;
    String inputData;
    for ( x = 1; x <= 10; x++)      //number of games played
    System.out.println("round " + x + ":");
    System.out.println(" ");
    System.out.println("I am thinking of a number from 1 to 10. ");
    System.out.println("You must guess what it is in three tries. ");
    System.out.println("Enter a guess: ");
    inputData = stdin.readLine();
    guess = Integer.parseInt( inputData );
    val = Math.random() * 10 % limit + 1;     //max limit is set to 9
    NumberFormat nf = NumberFormat.getNumberInstance();
    nf.setMaximumFractionDigits(0);               //format number of decimal places
    String s = nf.format(val);
    val = Integer.parseInt( s );
         for ( n = 1; n <= 3; n++ )      //number of guess's made
                   if ( guess == val)
                        System.out.println("RIGHT!!");                    //if guess is right
                        a = a + 1;
                        System.out.println("You have won " + a + " out of " + x + " rounds");
    System.out.println(" ");
    n = 3;
    continue;
              if (n == 3 && guess != val)                         //3 guesses and guess is wromg
                        System.out.println("wrong");
    System.out.println("The correct number was " + val);
                        System.out.println("You have won " + a + " out of " + x + " rounds");
    System.out.println(" ");
    continue;
                   //how close guess is to value
                   if ( guess == val - 1 || val + 1 == guess) //Within 1
                   System.out.println("hot");
         else if ( guess == val - 2 || val + 2 == guess) // Within 2
                   System.out.println("warm");
              else
                   System.out.println("cold");                         // Greater than 3
         inputData = stdin.readLine();
         guess = Integer.parseInt( inputData );
    //ratings
    if ( a <= 7)
         System.out.println("Your rating is: imbecile.");
    else if ( a <= 8)
         System.out.println("Your rating is: getting better but, dumb.");
    else if (a <= 9)
         System.out.println("Your rating is: high school grad.");
    else if ( a == 10)
         System.out.println("Your rating is: College Grad.!!!");

    Try this.
    By saying that, I expect you ,and your classmate(s), to study this example and then write your own. Hand it in as-is and you'll be rumbled as a homework-cheat in about 20ms ;)
    When you have an attempt where you can explain, without refering to notes, every single line, you've cracked it.
    Also (hint) comment your version well so your tutor is left with the impression you know what you're doing.
    In addition (huge hint) do not leave the static inner class 'NumberGuesser' where it is. Read your course notes and find out where distinct classes should go.
    BTW - Ever wonder if course tutors scan this forum for students looking for help and/or cheating?
    It's a double edged sword for you newbies. If you ask a sensible, well researched question, get helpful answers and apply them to your coursework, IMHO you should get credit for doing that.
    On the other hand, if you simply post your assignment and sit there hoping some sucker like me will do it for you, you should be taken aside and given a good kicking - or whatever modern educational establishments consider appropriate abmonishment ;)
    I'd say this posting is, currently, slap bang between the two extreemes, so impress us. Post your solution in the form you intend to hand it in, and have us comment on it.
    Good luck!
    import java.io.InputStreamReader;
    import java.io.BufferedReader;
    public class GuessingGame
         public static void main(String[] args)
              throws Exception
              BufferedReader reader= new BufferedReader(
                   new InputStreamReader(System.in));
              NumberGuesser guesser= new NumberGuesser(0, 100);
              System.out.println(
                   "\nThink of a number between 0 and 100, oh wise one...");
              int guess= 0;
              while (true) {
                   guess= guesser.guess();
                   System.out.print("\nIs it " +guesser.guess() +"? (h/l/c) ");
                   String line= reader.readLine();
                   if (line == null) {
                        System.out.println(
                             "\n\nLeaving? So soon? But we didn't finish the game!");
                        break;
                   if (line.length() < 1) {
                        System.out.println("\nPress a key, you muppet!");
                        continue;
                   switch (line.toLowerCase().charAt(0)) {
                        case 'h':  
                             guesser.higher();
                             break;
                        case 'l':     
                             guesser.lower();
                             break;
                        case 'c':
                             System.out.println("\nThank you for playing.");
                             System.exit(0);
                        default:
                             System.out.println(
                                  "\nHow hard can it be? Just press 'h' 'l' or 'c', ok?");
                             continue;
                   if (guess == guesser.guess()) {
                        System.out.println(
                             "\nIf you're going to cheat, I'm not playing!");
                        break;
         private static class NumberGuesser
              private int mLower;
              private int mUpper;
              private int mGuess;
              NumberGuesser(int lowerLimit, int upperLimit)
                   mLower= lowerLimit;
                   mUpper= upperLimit;
                   makeGuess();
              private void makeGuess() {
                   mGuess= mLower + ((mUpper - mLower) / 2);
              int guess() {
                   return mGuess;
              void higher()
                   mLower= mGuess;
                   makeGuess();
              void lower()
                   mUpper= mGuess;
                   makeGuess();
    }                  

  • Help with a pong game please

    I bought the book Java (all in one for dummies) and I tried writing up a code to start a pong like game and I keep on receiving this error :
    --------------------Configuration: Pong - jre1.6.0_07 <Default> - <Default>--------------------
    C:\Users\Adrian\Documents\JCreator LE\MyProjects\Pong\src\PongFrame.java:121: '{' expected
    class Ball exntends Ellipse2D.Float
    ^
    1 error
    Process completed.
    This is my code I've written :
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.geom.*;
    import java.util.concurrent.*;
    public class Pong extends JApplet
         public static final int WIDTH = 400;
         public static final int HEIGHT = 400;
         private PaintSurface canvas;
         public void init()
              this.setSize(WIDTH, HEIGHT);
              canvas = new PaintSurface();
              this.add(canvas, BorderLayout.CENTER);
              ScheduledThreadPoolExecutor executor =
                   new ScheduledThreadPoolExecuter(3);
              executor.scheduleAtFixedRate(new AnimationThread(this),
              0L, 20L, TimeUnit.MILLISECONDS);
    class AnimationThread implements Runnable
         JApplet c;
         public AnimationThread(JApplet c)
              this.c = c;
         public void run()
              c.repaint();
    class PaintSurface extends JComponent
         int paddle_x = 0;
         int paddle_y = 360;
         int score = 0;
         float english = 1.0f;
         Ball ball;
         Color[] color = {Color.Red, Color.Orange,
                              Color.Magenta, Color.Orange,
                              Color.Cyan, Color.Blue};
         int colorIndex;
         public PaintSurface()
              addMouseMotionListener(new MouseMotionAdapter()
                   public void mouseMoved(MouseEvent e)
                        if (e.getX() - 30 - paddle_x > 5)
                             english = 1.5f;
                        else if (e.getX() - 30 - paddle_x < -5)
                             english = -1.5f;
                        else
                             english = 1.0f;
                        paddle_x = e.getX() - 30;
              ball = new Ball(20);
         public void paint (Graphics g)
              Graphics2D g2 = (Graphics2D)g;
              g2.setRenderingHint(
                   RenderingHints.KEY_ANTIALIASING,
                   RenderingHints.VALUE_ANTIALIAS_ON);
              Shape paddle = new Rectangle2D.Float(
                   paddle_x, paddle, 60, 8);
              g2.SetColor(color[colorIndex % 6]);
              if (ball.intersects (paddle_x, paddle_y, 60, 8)
                   && ball.y_speed > 0)
                   ball.y_speed = -ball.y_speed;
                   ball.x_speed = (int)(ball.x_speed * enlish);
                   if (english != 1.0f)
                        colorIndex++;
                   score += Math.abs(ball.x_speed * 10);
                   if (ball.getY() + ball.getHeight()
                        >= Pong.HEIGT)
                        ball = new Ball (20);
                        score -= 1000;
                        colorIndex = 0;
                   ball.move();
                   g2.fill(ball);
                   g2.setColor(Color.BLACK);
                   g2.fill(paddle);
                   g2.drawString("Score: " + score, 250, 20);
    class Ball exntends Ellipse2D.Float
         public int x_speed, y_speed;
         private int d;
         private int width = Pong.WIDTH;
         private int height = Pong.HEIGHT;
         public Ball(int diamater)
              super((int)(Math.random() * (Pong.WIDTH - 20) + 1),
                   0, diameter, diameter);
                   this.d = diameter;
                   this.x_speed = (int)(Math.random() * 5 + 5);
                   this.y_speed = (int)(Math.random() * 5 + 5);
         public void move()
              if (super.x < 0 || super.x > width - d)
                   x_speed = -x_speed;
              if (super.y < 0 || super.y > height - d)
                   y_speed = -y_speed;
              super.x += x_speed;
              super.y += y_speed;
    Edited by: Hottik on Nov 16, 2008 12:33 PM

    I'm using Java a lot for school and I don't have much knowledge about game programming, but I've looked at the code and found multiple typo's, wich caused most of the problems. So use an IDE, they often reveal most of your problems =)
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.geom.*;
    import java.util.concurrent.*;
    public class Pong extends JApplet
         public static final int WIDTH = 400;
         public static final int HEIGHT = 400;
         private PaintSurface canvas;
         public void init()
              this.setSize(WIDTH, HEIGHT);
              canvas = new PaintSurface();
              this.add(canvas, BorderLayout.CENTER);
              ScheduledThreadPoolExecutor executor =new ScheduledThreadPoolExecutor(3);
              executor.scheduleAtFixedRate(new AnimationThread(this),
              0L, 20L, TimeUnit.MILLISECONDS);
    class AnimationThread implements Runnable
         JApplet c;
         public AnimationThread(JApplet c)
              this.c = c;
         public void run()
              c.repaint();
    class PaintSurface extends JComponent
         int paddle_x = 0;
         int paddle_y = 360;
         int score = 0;
         float english = 1.0f;
         Ball ball;
         Color[] color = {Color.RED, Color.ORANGE,Color.MAGENTA, Color.ORANGE,Color.CYAN, Color.BLUE};
         int colorIndex;
         public PaintSurface()
              addMouseMotionListener(new MouseMotionAdapter()
                   public void mouseMoved(MouseEvent e)
                        if (e.getX() - 30 - paddle_x > 5)
                        english = 1.5f;
                        else if (e.getX() - 30 - paddle_x < -5)
                        english = -1.5f;
                        else
                        english = 1.0f;
                        paddle_x = e.getX() - 30;
         ball = new Ball(20);
         public void paint (Graphics g)
         Graphics2D g2 = (Graphics2D)g;
         g2.setRenderingHint(
         RenderingHints.KEY_ANTIALIASING,
         RenderingHints.VALUE_ANTIALIAS_ON);
         Shape paddle = new Rectangle2D.Float(paddle_x, paddle_y, 60, 8);
         g2.setColor(color[colorIndex % 6]);
         if (ball.intersects (paddle_x, paddle_y, 60, 8)
         && ball.y_speed > 0)
         ball.y_speed = -ball.y_speed;
         ball.x_speed = (int)(ball.x_speed * english);
         if (english != 1.0f)
         colorIndex++;
         score += Math.abs(ball.x_speed * 10);
         if (ball.getY() + ball.getHeight()
         >= Pong.HEIGHT)
         ball = new Ball (20);
         score -= 1000;
         colorIndex = 0;
         ball.move();
         g2.fill(ball);
         g2.setColor(Color.BLACK);
         g2.fill(paddle);
         g2.drawString("Score: " + score, 250, 20);
    class Ball extends Ellipse2D.Float
    public int x_speed, y_speed;
    private int d;
    private int width = Pong.WIDTH;
    private int height = Pong.HEIGHT;
         public Ball(int diamater)
              super((int)(Math.random() * (Pong.WIDTH - 20) + 1),0, diamater, diamater);
              this.d = diamater;
              this.x_speed = (int)(Math.random() * 5 + 5);
              this.y_speed = (int)(Math.random() * 5 + 5);
         public void move()
              if (super.x < 0 || super.x > width - d)
              x_speed = -x_speed;
              if (super.y < 0 || super.y > height - d)
              y_speed = -y_speed;
              super.x += x_speed;
              super.y += y_speed;
    }

  • Side Scrolling Game Help

    Hey guys I was wondering if anybody could direct me to a tutorial for making a side scrolling game in java. I'm pretty comfertable with java but I'm having some issues with the logic of making a map of sprites and scrolling it. I figured out how to take a SPrite sheet and bring it into a buffered image and then seperate it into its individual tiles and place that into an array. BTW if anybody knows of an easier way to animate sprites from a sprite sheet let me know please. Thanks,
    Darcmagik

    Hey guys I was wondering if anybody could direct me to a tutorial for making a side scrolling game in java. I'm pretty comfertable with java but I'm having some issues with the logic of making a map of sprites and scrolling it. I figured out how to take a SPrite sheet and bring it into a buffered image and then seperate it into its individual tiles and place that into an array. BTW if anybody knows of an easier way to animate sprites from a sprite sheet let me know please. Thanks,
    Darcmagik

  • Need some help with the colour profile please. Urgent! Thanks

    Dear all, I need help with the colour profile of my photoshop CS6. 
    I've taken a photo with my Canon DSLR. When I opened the raw with ACDSee, the colour looks perfectly ok.
    So I go ahead and open in photoshop. I did nothing to the photo. It still looks ok
    Then I'm prompt the Embedded Profile Mismatch error. I go ahead and choose Discard the embedded profile option
    And the colour started to get messed up.
    And the output is a total diasater
    Put the above photo side by side with the raw, the red has became crimson!!
    So I tried the other option, Use the embedded profile
    The whole picture turns yellowish in Photoshop's interface
    And the output is just the same as the third option.
    Could someone please guide me how to fix this? Thank you.

    I'm prompt the Embedded Profile Mismatch error. I go ahead and choose Discard the embedded profile option
    always use the embedded profile when opening tagged images in Photoshop - at that point Photoshop will convert the source colors over to your monitor space correctly
    if your colors are wrong at that point either your monitor profile is off, or your source colors are not what you think they are - if other apps are displaying correctly you most likely have either a defective monitor profile or source profile issues
    windows calibrate link:
    http://windows.microsoft.com/en-US/windows7/Calibrate-your-display
    for Photoshop to work properly, i recall you want to have "use my settings for this device" checked in Color Management> Device tab
    you may want to download the PDI reference image to check your monitor and print workflows
    and complete five easy steps to profile enlightenment in Photoshop
    with your settings, monitor profile and source profiles sorted out it should be pretty easy to pinpoint the problem...

  • Side Scrolling game

    im looking into making a 2D side scrollng game (like original mario was) and was wondering if anyone can point me in the direction of the stuff i need to know. I know the challenge, i jsut need documentations or something like that.
    Also it would help if i knew how to read the API's >_<

    I would use java.awt.Rectangle for detecting collisions and stuff.
    Maybe make classes for the people and non-moveable objects with the Rectangle or Image(s).
    KeyListener on a main JPanel for detecting keyboard input perhaps.

  • Help with css3 rollover tag please

    Hey guys I'm stumped and need help with positioning some big picture buttons.
    Here is the link o the home page http://ceramic-planet2.businesscatalyst.com/
    As u can see I have four picture buttons using css3 roller but I want all four buttons next to each other
    2 buttons next to each other with the next 2 directly below .
    Now orgininally I used the dreamweaver rollover button and everything was inline so flowed across the page no problem. These are divs and I've tried to make 2 panels side by side among other hings but I'm not getting there so I thought one of u clever guys would have no problems telling me what to do.
    Please help I'm not getting the inline or absolute placement right
    Dave

    Hey Dave,
    You need to remove the margin from #mosaicbutton, #kitchenbutton
    and then add float : left; to #bathroombutton, #floorbutton, #mosaicbutton, #kitchenbutton,
    That'll get you buttons sitting the way you want them, you may need to play with the margins after that.
    Pat

  • Help with a scrolling flash panel

    Hello, Ive used the excellent tutorial to create a scrolling thumb panel (http://library.creativecow.net/articles/brimelow_lee/scrolling_thumbnail_panel/video-tutor ial.php)
    It works brilliantly and I have movie thumbs linking to a flash player. It all works fine, what Im needing help with is to change the scrolling.
    At current it scrolls up and down according to where I have set the 'line', I would like it to scroll up and down near the top and the bottom, rather than all the time (effectively creating a dead zone in the middle). I cant figure out how to change the code to get this to behave as required.
    Please Help!
    Below is the code used:
    panel.onRollOver = panelOver;
    function panelOver() {
    this.onEnterFrame = scrollPanel;
    delete this.onRollOver;
    var b = stroke.getBounds(_root);
    function scrollPanel() {
    if(_ymouseb.yMax || _xmouseb.xMax) {
    this.onRollOver = panelOver;
    delete this.onEnterFrame;
    if(panel._y >= 278) {   //FIRST BUTTON 'Y' POSITION
    panel._y = 278;
    if(panel._y <= -177) { //CHANGE '229' TO THE 'Y' POSITION OF THE LAST BUTTON IN THE 'PANEL' MOVIE, POSITIONED VISIBLE WITHIN THE BOARDERS.
    panel._y = -177;
    var ydist = _ymouse - 251; //POSITION ON STAGE OF UP/DOWN SCROLLING 'LINE'
    panel._y += -ydist / 150;   //SPEED OF SCROLLING (LOWER = HIGHER)

    use:
    panel.onRollOver = panelOver;
    function panelOver() {
    this.onEnterFrame = scrollPanel;
    delete this.onRollOver;
    var b = stroke.getBounds(_root);
    function scrollPanel() {
    if(_ymouseb.yMax || _xmouseb.xMax) {
    this.onRollOver = panelOver;
    delete this.onEnterFrame;
    if(panel._y >= 278) {   //FIRST BUTTON 'Y' POSITION
    panel._y = 278;
    if(panel._y <= -177) { //CHANGE '229' TO THE 'Y' POSITION OF THE LAST BUTTON IN THE 'PANEL' MOVIE, POSITIONED VISIBLE WITHIN THE BOARDERS.
    panel._y = -177;
    var ydist = _ymouse - 251; //POSITION ON STAGE OF UP/DOWN SCROLLING 'LINE'
    if(_ymouse>lowerY || _ymouse<upperY){
    if((_ymouse>lowerY){
    ydist=_ymouse-lowerY;  // define lowerY
    } else {
    ydist=_ymouse-upperY;  // define upperY
    } else {
    ydist=0;
    panel._y += -ydist / 150;   //SPEED OF SCROLLING (LOWER = HIGHER)

  • Need help with threads?.. please check my approach!!

    Hello frnds,
    I am trying to write a program.. who monitors my external tool.. please check my way of doing it.. as whenever i write programs having thread.. i end up goosy.. :(
    first let me tell.. what I want from program.. I have to start an external tool.. on separate thread.. (as it takes some time).. then it takes some arguments(3 arguments).. from file.. so i read the file.. and have to run tool.. continously.. until there are arguments left.. in file.. or.. user has stopped it by pressing STOP button..
    I have to put a marker in file too.. so that.. if program started again.. file is read from marker postion.. !!
    Hope I make clear.. what am trying to do!!
    My approach is like..
    1. Have two buttons.. START and STOP on Frame..
    START--> pressed
    2. check marker("$" sign.. placed in beginning of file during start).. on file..
         read File from marker.. got 3 arg.. pass it to tool.. and run it.. (on separate thread).. put marker.. (for next reading)
         Step 2.. continously..
    3. STOP--> pressed
         until last thread.. stops.. keep running the tool.. and when last thread stops.. stop reading any more arguments..
    Question is:
    1. Should i read file again and again.. ?.. or read it once after "$" sign.. store data in array.. and once stopped pressed.. read file again.. and put marker ("$" sign) at last read line..
    2. how should i know when my thread has stopped.. so I start tool again??.. am totally confused.. !!
    please modify my approach.. if u find anything odd..
    Thanks a lot in advance
    gervini

    Hello,
    I have no experience with threads or with having more than run "program" in a single java file. All my java files have the same structure. This master.java looks something like this:
    ---master.java---------------------------------------------------
    import java.sql.*;
    import...
    public class Master {
    public static void main(String args []) throws SQLException, IOException {
    //create connection pool here
    while (true) { // start loop here (each loop takes about five minutes)
    // set values of variables
    // select a slave process to run (from a list of slave programs)
    execute selected slave program
    // check for loop exit value
    } // end while loop
    System.out.println("Program Complete");
    } catch (Exception e) {
    System.out.println("Error: " + e);
    } finally {
    if (rSet1 != null)
    try { rSet1.close(); } catch( SQLException ignore ) { /* ignored */ }
    connection.close();
    -------end master.java--------------------------------------------------------
    This master.java program will run continuously for days or weeks, each time through the loop starting another slave process which runs for five minutes to up to an hour, which means there may be ten to twenty of these slave processes running simultaneously.
    I believe threads is the best way to do this, but I don't know where to locate these slave programs: either inside the master.java program or separate slave.java files? I will need help with either method.
    Your help is greatly appreciated. Thank you.
    Logan

  • Help with smooth scrolling (masked movie clip)

    Ok, I really need help here, and I'll be very grateful for
    help before Monday.
    Someone has made a movie with a different set of text on each
    frame, the text goes out of the viewable area.
    I have been asked to make these frames appear in a pop-up on
    another flash and be scrollable.
    i thought this would be easy...just cut and paste them into a
    movie clip, then using a mask to hide the rest of the text.
    However, it is going painstakingly slow.
    Seems to be a performance issue, but it might be my code.
    Any help with the code, or optimisation elsewhere would be
    helpfully.
    Heres a simplified version of the flash;
    www.darkflame.co.uk/flashwork/Flash_popuptest.fla
    Code for the scrolling;
    _global.MoveUp = function(text) {
    _root.ITproduct.IT_productlist._y =
    _root.ITproduct.IT_productlist._y+6;
    updateAfterEvent();
    //trace('press');
    Called and stopped by;
    on (press){
    //this._parent.IT_productlist._y =
    this._parent.IT_productlist._y +10;
    //_global.scrollon = "yes";
    clearInterval(IntervalID);
    IntervalID = setInterval(MoveUp,100);
    updateAfterEvent()
    //updateAfterEvent();
    //MoveUp();
    //scroll on
    on (release) {
    //this._parent.IT_productlist._y =
    this._parent.IT_productlist._y +10;
    clearInterval(IntervalID);
    updateAfterEvent();
    //scroll off
    which is linked to a button.
    I dont know if this is a actionscript problem, or the way the
    page is made, or both.
    Any help would be appreciated.
    Thanks in advance,
    Thomas Wrobel

    you have extraneous graphics on-stage that are slowing the
    scrolling (and even causing problems in the authoring environment).
    here's your file with those graphics removed:
    http://www.gladstien.com/Files.popupTest.fla

  • Need help with ending a game

    i'm making a game at the moment.......
    i need help with a way to check all the hashmaps of enimies in a class called room......i need to check if they all == 0...when they all equal zero the game ends......
    i know i can check the size of a hash map with size().....but i want to check if all the hashmaps within all the rooms == 0.

    First of all stop cross posting. These values in the HashMap, they are a "Collection" of values, so what is wrong with reply two and putting all these collections of values into a super collection? A collection of collections? You can have a HashMap of HashMaps. One HashMap that holds all your maps and then you can use a for loop to check if they are empty. A map is probably a bad choice for this operation as you don't need a key and an array will be much faster.
    HashMap [] allMaps = {new HashMap(),new HashMap()};

  • Need help with flash player installation please !!!!

    Hello,
    I need help with my flash player installation because every time I access a movie this is the message I receive. 
    This content on Xfinity TV is not available for viewing with Chrome's "Incognito" mode. To play this video using Chrome, please view this page without "Incognito" mode.
    Still having problems? Try resetting your Flash player license.

    Incognito mode is a Google Chrome setting when you open a new window (Cmd+Shift+N on a Mac Ctrl+Shift+N on Windows) It opens a "private" window with no cookies and no tracking. The problem with it is that when you disable cookies, your license files are not sent to the site (whetehr it's YouTube or xFinity or any other that uses license files for paid content)  and it treats you as if you're a first time visitor. Paid videos won't play wihtout the cookies sending the license file info.
    This isn't a Flash Player setting. It's in Chrome. I did some research and according to Google, "Incignito" mode is off by default, and can ONLY be activate by the keyboard shortcut. There IS a way to disable it from the registry http://dev.chromium.org/administrators/policy-list-3#IncognitoModeAvailability

  • Need help with video-scroll

    Hello,
    I need some help with a project. What I eventually want is that a webcam controls the mouse position and the mouse position
    controls a video. But first I would like the part where the mouse position controls the video.
    So if the mouse is on the left on your screen the video will be at the first frame and when you move you're mouse to
    the right the video will play accordingly to the movement. and stop when the mouse is all the way to the right.
    Effectivly the mouse scrolles through the video. It only needs to be on the x-axis.
    I'm not that formilliar with flash so any help would be great
    Thx!
    Thijs

    I fixed it in an other way.
    Made a imgseq and following code (with some help ):
              stop();
              stage.addEventListener(Event.RESIZE, resizeHandler);
              stage.addEventListener(FullScreenEvent.FULL_SCREEN, resizeHandler);
              stage.addEventListener(MouseEvent.MOUSE_MOVE, inputHandler);
              stage.scaleMode = StageScaleMode.NO_SCALE;
              stage.align = StageAlign.TOP_LEFT;
              var imgSeq:ImgSeq = new ImgSeq();
              var columnWidth;
              var numColumns;
              stage.addChild(imgSeq);
              imgSeq.x = 350
              imgSeq.gotoAndStop(1);
              columnWidth = stage.stageWidth / imgSeq.totalFrames;
              numColumns = stage.stageWidth / columnWidth;
              function resizeHandler(e:Event):void {
              // verdeel het scherm in kolommen, iedere keer dat het scherm geresized wordt.
                        // breedte van 1 kolom (schermbreedte gedeeld door aantal plaatjes)
                        columnWidth = stage.stageWidth / imgSeq.totalFrames;
                        // totaal aantal kolommen dat binnen het scherm past (breedte gedeeld door breedte van één kolom )
                        numColumns = stage.stageWidth / columnWidth;
              function inputHandler(e:MouseEvent):void {
              // voer dit iedere keer dat je de muis beweegt uit.
                        // kijk voor iedere kolom of de muis er binnen valt.
                        for(var i = 1; i <= numColumns; i++){
                                  //vergelijking die checkt of de muispositie binnen de waarden van kolom valt.
                                  if(mouseX <= i * columnWidth && mouseX >= (i * columnWidth) - columnWidth ){
                                            // zet het framenummer van de imageSequence gelijk aan de huidige kolom.
                                            imgSeq.gotoAndStop(i);
    many thx!

  • Some help with the 10g install, please.

    Hi,
    We want to install 10g, we are currently running 9i. We want to do this in silent mode since we have so many databases to move to 10g. We've got a few questions & concerns about the procedures that are supposed to be done.
    If someone could kindly read over some of our concerns, we'd appreciate it.
    First, we used the -record method to create a response file. How much do we have to manually edit that file once Oracle creates it for us? Or is it ready to go after we exit the OUI.
    When we tried to do the install, it said it successfully installed 10g, but it failed on some of the configuration assistants. Do we need to run all of the configuration assistants? I mean, TNS is already configured. Does it change for the 10g install?
    Additionally, once the 10g software is complete, the environment is still set to 9i. How does that get changed for the silent install to continue with the DBUA? I mean, we do have databases that need upgrading.
    Any help with steps would be very helpful to us. We're getting error messages like this:
    The installation of Oracle Database 10g was successful, but some
    optional configuration assistants failed, were cancelled or skipped.
    Please check
    '/ora2/app/oracle/oraInventory/logs/silentInstall2006-10-26_01-26-39PM.log'
    for more details.
    UnsatisfiedLinkError exception loading native library: njni10
    java.lang.UnsatisfiedLinkError: jniGetOracleHome
    at oracle.net.common.NetGetEnv.getOracleHome(Unknown Source)
    at oracle.net.ca.NetCA.main(Unknown Source)
    Oracle Net Services configuration failed. The exit code is -1
    Thank you in advance for your help.

    Hi,
    You are installing in same ORACLE_HOME?
    Your Operation System is UNIX?
    Eder

  • Help with Rendering/Finalizing Project Please?

    Hi,
    I am so new to this entire Adobe and video making that I've spent the last few hours pulling hair literally.  I am hoping that some of you experts can take some time to give this novice some much needed guidance.  Okay, I'm begging!
    I recorded a wedding on a XHA1 MiniDV camera in 1080p 24fps.  Captured the clips to PP CS4 which in turn makes them MPEG, I believe.  Included in my project are addition clips imported from a Canon HF S21 also in 1080p 24fps and a Rebel T2i in ?? format.  Didn't use too many clips from the rebel. 
    Anyhow, my project settings in PP are:
    Video -  Display format = Frames
    Audio - Display format = Audio Samples
    Capture Format = HDV
    All Scratch disks are saved on to my desktop with 284 GB
    Here is a picture of the sequence settings:
    Again, sorry for the ignorance and stupiditiy.  I am wondering what would help.
    I am trying to burn it all with chapter markers and additional features to a DVD.
    - What would be the BEST settings for exporting to Encore? 
    - Should I separate each section into a different sequence - would that help?  For example, the pre-ceremony to one sequence.  The ceremony to another.  The reception to another.    Or should I make new projects for each? 
    - How can I make my computer faster?  Is it the memory, ram, etc?  What should I do?
    Right now, it has failed over and over in rendering in After Effects.  It stops encoding when I export to AME.  It says 158 hours for rendering in PP.
    HELP!
    I am using an iMac and here are computer specs (again, I am not even sure what to post to help you all help me):
      Model Name: iMac
      Model Identifier: iMac11,3
      Processor Name: Intel Core i7
      Processor Speed: 2.93 GHz
      Number Of Processors: 1
      Total Number Of Cores: 4
      L2 Cache (per core): 256 KB
      L3 Cache: 8 MB
      Memory: 8 GB
      Processor Interconnect Speed: 4.8 GT/s
      Boot ROM Version: IM112.0057.B00
      SMC Version (system): 1.59f2
    Here is a pic of what I'm working on.  I know the pic-in-pic feature probably doesn't help with rendering time either but 158 hours is killing me.  In fact, when I go to sleep, I wake up to an error message where PP has closed.

    leevang,
           Your computer looks great.  I wouldn't be too worried about the time PP shows for encoding etc.
    I have found that right when I first start to encode a project, 73 hours or 12 hours is normal. Rendering is not necessary for encoding.  However  when I look back later, the time has dropped greatly.
    Down to 2 or 3 hours.  that's when I follow Jeff B.'s suggestions when I do a  2X scan.......

Maybe you are looking for

  • System image utility fails "Unknown error has occurred"

    Hi, I can create disk images from 10.8.3 clients but when i'm putting them through system utility on the 10.8 server it fails after hours of running. The log is set to debug and shows the image creates upto 83% then jumps to 100% and later shows unkn

  • Connot download adobe flash player

    connot download adobe flash player

  • My Imac 24" alu screen will not go to sleep!

    Just got my new Imac Alu 24" 2,8 Ghz with the Geforce card. In energy savings i set my monitor to go to sleep after 10 min. But nothing happens! Any tips on this issue? My Imac will run 24h a day in this is not good! Message was edited by: drifter750

  • Throwing Business Exception from Human Task

    Hi, Can anyone point me to some examples, of how can I configure a Human Task to throw a business exception in a BPMN process ? I want to provide th user with the ability of completing the task normaly, or launch a business exception like, cancel the

  • Simultaneo​us temperatur​e and voltage measuremen​t

    We have a NI-4351 to measure both the temperature and a voltage across a resistor. We have utilized two successive flat sequence structure frames, each containing an AI-Single Scan SubVI, to first scan the voltage off the thermocouple, and the second