Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 11 of 11

Thread: how can i set an object in focus

  1. #1
    Junior Member
    Join Date
    Sep 2013
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default how can i set an object in focus

    There is a Canvas object in my game and this object is not set in focus, because of this my snake is not moving on the Board .

    Basically i am working on snake game project, and i want is when play button is clicked from PlayGame.java JDialog ,game should start ,but problem i am facing is after clicking button gamescreen appearing on window but snake is not moving, so someone suggest me that your canvas object is not in focus whenever it is called. that is why KeyLisener not able to listen to keyPresses /key strokes.

    This is the class in which canvas object is declared and implemented.

    package org.psnbtech;
     
    import java.awt.Canvas;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.Graphics2D;
    import java.awt.RenderingHints;
    import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    import javax.swing.JFrame;
    import org.psnbtech.GameBoard.TileType;
    import org.psnbtech.Snake.Direction;
     
     
    public class Engine extends KeyAdapter {
     
        private static final int UPDATES_PER_SECOND = 15;
     
        private static final Font FONT_SMALL = new Font("Arial", Font.BOLD, 20);
     
        private static final Font FONT_LARGE = new Font("Arial", Font.BOLD, 40);
     
        public Canvas canvas;
     
        public GameBoard board;
     
        public Snake snake;
     
        public int score;
     
        public boolean gameOver;
     
     
        public Engine(Canvas canvas) {
                    this.canvas = canvas;
                this.board = new GameBoard();
            this.snake = new Snake(board);
     
            resetGame();
     
            canvas.addKeyListener(this);
                    //new Engine(canvas).startGame();
        }
     
     
        public void startGame() {
            canvas.createBufferStrategy(2);
     
            Graphics2D g = (Graphics2D)canvas.getBufferStrategy().getDrawGraphics();
            g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
     
            long start = 0L;
            long sleepDuration = 0L;
            while(true) {
                start = System.currentTimeMillis();
     
                update();
                render(g);
     
                canvas.getBufferStrategy().show();
     
                g.clearRect(0, 0, canvas.getWidth(), canvas.getHeight());
     
                sleepDuration = (1500L / UPDATES_PER_SECOND) - (System.currentTimeMillis() - start);
     
                if(sleepDuration > 0) {
                    try {
                        Thread.sleep(sleepDuration);
                    } catch(Exception e) {
                                        e.printStackTrace();
                    }
                }
            }
        }
     
        public void update() {
            if(gameOver || !canvas.isFocusable()) {
                return;
            }
            TileType snakeTile = snake.updateSnake();
            if(snakeTile == null || snakeTile.equals(TileType.SNAKE)) {
                gameOver = true;
            } else if(snakeTile.equals(TileType.FRUIT)) {
                score += 10;
                spawnFruit();
            }
        }
     
        public void render(Graphics2D g) {
            board.draw(g);
     
            g.setColor(Color.WHITE);
     
            if(gameOver) {
                g.setFont(FONT_LARGE);
                String message = new String("Your Score: " + score);
                g.drawString(message, canvas.getWidth() / 2 - (g.getFontMetrics().stringWidth(message) / 2), 250);
     
                g.setFont(FONT_SMALL);
                message = new String("Press Enter to Restart the Game");
                g.drawString(message, canvas.getWidth() / 2 - (g.getFontMetrics().stringWidth(message) / 2), 350);
            } else {
                g.setFont(FONT_SMALL);
                g.drawString("Score:" + score, 10, 20);
            }
        }
     
        public void resetGame() {
            board.resetBoard();
            snake.resetSnake();
            score = 0;
            gameOver = false;
            spawnFruit();
        }
     
        public void spawnFruit() {
            int random = (int)(Math.random() * ((GameBoard.MAP_SIZE * GameBoard.MAP_SIZE) - snake.getSnakeLength())); // if '*' replace by '/' then only one fruit is there for snake
     
            int emptyFound = 0;
            int index = 0;
            while(emptyFound < random) {
                index++;
                if(board.getTile(index % GameBoard.MAP_SIZE, index / GameBoard.MAP_SIZE).equals(TileType.EMPTY)) { // if '/' replaced by '*' then nothing displays on the board 
                    emptyFound++;
                }
            }
            board.setTile(index % GameBoard.MAP_SIZE, index / GameBoard.MAP_SIZE, TileType.FRUIT); // it also show nothing when replacing '/' by '/' 
        }
     
        @Override
        public void keyPressed(KeyEvent e) {
            if((e.getKeyCode() == KeyEvent.VK_UP)||(e.getKeyCode() == KeyEvent.VK_W)) {
                snake.setDirection(Direction.UP);
            }
            if((e.getKeyCode() == KeyEvent.VK_DOWN)||(e.getKeyCode() == KeyEvent.VK_S)) {
                snake.setDirection(Direction.DOWN);
            }
            if((e.getKeyCode() == KeyEvent.VK_LEFT)||(e.getKeyCode() == KeyEvent.VK_A)) {
                snake.setDirection(Direction.LEFT);
            }
            if((e.getKeyCode() == KeyEvent.VK_RIGHT)||(e.getKeyCode() == KeyEvent.VK_D)) {
                snake.setDirection(Direction.RIGHT);
            }
            if(e.getKeyCode() == KeyEvent.VK_ENTER && gameOver) {
                resetGame();
            }
        }
     
             public static void main(String[] args)  {
            new PlayGame().setVisible(true);
     
            /**JFrame frame = new JFrame("SnakeGame");
            frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
            frame.setResizable(false);
     
            Canvas canvas = new Canvas();
            canvas.setBackground(Color.black);
            canvas.setPreferredSize(new Dimension(GameBoard.MAP_SIZE * GameBoard.TILE_SIZE, GameBoard.MAP_SIZE * GameBoard.TILE_SIZE));
     
            frame.getContentPane().add(canvas);
            frame.pack();
            frame.setLocationRelativeTo(null);
            frame.setVisible(true); 
     
            new Engine(canvas).startGame();*/
     
     
                 }        
    }

    And also i am attching actionPerformed() method of Play Button where i am referring canvas object

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        JFrame frame = new JFrame("SnakeGame"); 
        frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
        frame.setResizable(false);
     
        Canvas canvas = new Canvas();
        canvas.setBackground(Color.black);
        canvas.setPreferredSize(new Dimension(GameBoard.MAP_SIZE *GameBoard.TILE_SIZE,GameBoard.MAP_SIZE * GameBoard.TILE_SIZE));
     
        frame.add(canvas);
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true); 
     
        new Engine(canvas).startGame();
     
        }


    --- Update ---

    So please tell/suggest me how can i set canvas object in focus


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    18,574
    Thanks
    45
    Thanked 1,954 Times in 1,928 Posts

    Default Re: how can i set an object in focus

    The posted code does not compile to allow execution for testing. Can you make a small, complete program that compiles and executes for testing? Don't post a large program.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Sep 2013
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: how can i set an object in focus

    Actually this project Contain five java files .i show this code because it almost contaiinng most of the logic of snake game.
    five classes: 1. Engine.java
    2. Snake.java (declaring an enum Direction and updateSnake() , resetGame() method, setDirection())
    3. GameBoard.java (having enum TileType(Snake,Fruit,Empty) resetBoard() method ,setTile(), getTile(), draw() methods)
    4. PlayGame.java(is a JDialog, having three button Play button, Rules button, exit button and corresponding action)
    5. Rules.java (is a JDialog, have a single button when clicked return to playgame.java form )

    note: when play button gets clicked it should start the game ,the action is working but problem is snake is not moving
    so plz suggest some thing

    --- Update ---

    i will show u some code too

    Snake.java

     
    package org.psnbtech;
     
    import java.awt.Canvas;
    import java.awt.Point;
    import java.util.LinkedList;
     
    import org.psnbtech.GameBoard.TileType;
     
    public class Snake {
    	public Canvas canvas;
    	public static enum Direction {
     
    		UP,
     
    		DOWN,
     
    		LEFT,
     
    		RIGHT,
     
    		NONE
     
    	}
     
    	public Direction currentDirection;
     
    	public Direction temporaryDirection;
     
    	public GameBoard board;
     
    	public LinkedList<Point> points;
     
     
            public Snake(GameBoard board) {
    		this.canvas = canvas;
                    this.board = board;
    		this.points = new LinkedList<Point>();
     
            }
     
    	public void resetSnake() {		
    		this.currentDirection = Direction.NONE;
    		this.temporaryDirection = Direction.NONE;
     
    		Point head = new Point(GameBoard.MAP_SIZE / 2, GameBoard.MAP_SIZE / 2);
    		points.clear();
    		points.add(head);
    		board.setTile(head.x, head.y, TileType.SNAKE);		
    	}
     
    	public void setDirection(Direction direction) {
    		if(direction.equals(Direction.UP) && currentDirection.equals(Direction.DOWN)) {
    			return;
    		} else if(direction.equals(Direction.DOWN) && currentDirection.equals(Direction.UP)) {
    			return;
    		} else if(direction.equals(Direction.LEFT) && currentDirection.equals(Direction.RIGHT)) {
    			return;
    		} else if(direction.equals(Direction.RIGHT) && currentDirection.equals(Direction.LEFT)) {
    			return;
    		}
    		this.temporaryDirection = direction;
    	}
     
    	public TileType updateSnake() {
    		this.currentDirection = temporaryDirection;
     
    		Point head = points.getFirst();	
     
    		switch(currentDirection) {
     
    		case UP:
    			if(head.y <= 0) {
    				return null;
    			}
    			points.push(new Point(head.x, head.y - 1));
    			break;
     
    		case DOWN:
    			if(head.y >= GameBoard.MAP_SIZE - 1) {
    				return null;
    			}
    			points.push(new Point(head.x, head.y + 1));
    			break;
     
    		case LEFT:
    			if(head.x <= 0) {
    				return null;
    			}
    			points.push(new Point(head.x - 1, head.y));
    			break;
     
    		case RIGHT:
    			if(head.x >= GameBoard.MAP_SIZE - 1) {
    				return null;
    			}
    			points.push(new Point(head.x + 1, head.y));
    			break;
     
    		case NONE:
    			return TileType.EMPTY;
    		}
     
    		head = points.getFirst();
     
    		TileType oldType = board.getTile(head.x, head.y);
    		if(!oldType.equals(TileType.FRUIT)) {
    			Point last = points.removeLast();
    			board.setTile(last.x, last.y, TileType.EMPTY);
    			oldType = board.getTile(head.x, head.y);
    		}
     
    		board.setTile(head.x, head.y, TileType.SNAKE);
     
    		return oldType;
    	}
     
    	public int getSnakeLength() {
    		return points.size();
    	}
     
    	public Direction getCurrentDirection() {
    		return currentDirection;
    	}
     
    }

    GameBoard.java

    package org.psnbtech;
     
    import java.awt.Color;
    import java.awt.Graphics2D;
     
    public class GameBoard {
     
    	public static final int TILE_SIZE  = 20;
     
    	public static final int MAP_SIZE = 30;
     
    	public static enum TileType {
     
    		SNAKE(Color.GREEN),
     
    		FRUIT(Color.orange),
     
    		EMPTY(null);
     
     
                public Color tileColor;
     
    		private TileType(Color color) {
    			this.tileColor = color;
    		}
     
    		public Color getColor() {
    			return tileColor;
    		}
     
    	}
     
    	private TileType[] tiles;
     
    	public GameBoard() {
    		tiles = new TileType[MAP_SIZE * MAP_SIZE];
    	}
     
    	public void resetBoard() {
    		for(int i = 0; i < tiles.length; i++) {
    			tiles[i] = TileType.EMPTY;
    		}
    	}
     
    	public void setTile(int x, int y, TileType type) {
    		tiles[y * MAP_SIZE + x] = type;
    	}
     
    	public TileType getTile(int x, int y) {
    		return tiles[y * MAP_SIZE + x];
    	}
     
    	public void draw(Graphics2D g) {
    		g.setColor(TileType.SNAKE.getColor());
     
    		for(int i = 0; i < tiles.length; i++) {
    			int x = i % MAP_SIZE;
    			int y = i / MAP_SIZE;
     
    			if(tiles[i].equals(TileType.EMPTY)) {
    				continue;
    			}
     
    			if(tiles[i].equals(TileType.FRUIT)) {
    				g.setColor(TileType.FRUIT.getColor());
    				g.fillOval(x * TILE_SIZE + 4, y * TILE_SIZE + 4, TILE_SIZE - 8, TILE_SIZE - 8);
    				g.setColor(TileType.SNAKE.getColor());
    			} else {
    				g.fillRect(x * TILE_SIZE + 1, y * TILE_SIZE + 1, TILE_SIZE - 2, TILE_SIZE - 2);
    			}
    		}
    	}
     
    }


    --- Update ---

    plz if u can look up the code

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    18,574
    Thanks
    45
    Thanked 1,954 Times in 1,928 Posts

    Default Re: how can i set an object in focus

    Can you make a small, complete program that compiles and executes for testing?

    --- Update ---

    It needs to show the problem when it executes.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Sep 2013
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: how can i set an object in focus

    I have downloaded a snake game project from the internet, initially this project contains three java files namely
    1. Engine.java
    2. Snake.java
    3. Gameoard.java

    when i runs Engine.java ,game starts running ..

    Now i have done some modification in it to improve the interactivity of the game, i.e i have added two #JDialog named
    PlayGame.java
    , and
    RulesDialog.java
    .

    PlayGame.java has three JButtons :- Play button, Rules Button , Exit
    when
    play
    button gets clicked game should start
    when
    rules
    button gets clicked
    RulesDialog.java JDialog
    appears and when
    exit button
    gets clicked application or game should be closed.

    Action of button is set in the actionPerformed() method of individual buttons.
    Now
    problem
    i am facing is when i click
    Play button
    g
    ame window is visible on the screen but snake is not moving
    .

    and i am not getting to point how to resolve this problem ..
    So plz help me out

    --- Update ---

    I have downloaded a snake game project from the internet, initially this project contains three java files namely
    1. Engine.java
    2. Snake.java
    3. Gameoard.java

    when i runs Engine.java ,game starts running ..

    Now i have done some modification in it to improve the interactivity of the game, i.e i have added two #JDialog named
    1. PlayGame.java

    2. RulesDialog.java

    PlayGame.java has three JButtons :- Play button, Rules Button , Exit

    -when play button gets clicked game should start

    -when rules button gets clicked RulesDialog.java JDialog appears and when

    -exit button gets clicked application or game should be closed.

    Action of button is set in the actionPerformed() method of individual buttons.

    Now problem i am facing is when i click Play button game window is visible on the screen but snake is not moving

    and i am not getting to point how to resolve this problem ..

    So plz help me out

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    18,574
    Thanks
    45
    Thanked 1,954 Times in 1,928 Posts

    Default Re: how can i set an object in focus

    Can you make a small, complete program that compiles and executes for testing?
    If you don't understand my answer, don't ignore it, ask a question.

  7. #7
    Junior Member
    Join Date
    Sep 2013
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: how can i set an object in focus

    can u please elaborate what u want from me because i am not getting your point.

  8. #8
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    18,574
    Thanks
    45
    Thanked 1,954 Times in 1,928 Posts

    Default Re: how can i set an object in focus

    I need code that I can copy to my PC where I will compile it and execute it for testing to see the problem.
    The code should not be large (maybe 300 lines).
    If you don't understand my answer, don't ignore it, ask a question.

  9. #9
    Junior Member
    Join Date
    Sep 2013
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: how can i set an object in focus

    Ok. there is Engine.java class in my project which has almost all the methods to handle the game.
    So i am sendig u Engine.class . Or if u can say i will mail my project to you.

    package org.psnbtech;
     
    import java.awt.Canvas;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.EventQueue;
    import java.awt.Font;
    import java.awt.Graphics2D;
    import java.awt.RenderingHints;
    import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    import java.awt.event.KeyListener;
    import javax.swing.JFrame;
    import org.psnbtech.GameBoard.TileType;
    import org.psnbtech.Snake.Direction;
     
     
    public  class Engine extends KeyAdapter implements KeyListener  {
     
    	private static final int UPDATES_PER_SECOND = 15;
     
    	private static final Font FONT_SMALL = new Font("Arial", Font.BOLD, 20);
     
    	private static final Font FONT_LARGE = new Font("Arial", Font.BOLD, 40);
     
    	public Canvas canvas;
     
    	public GameBoard board;
     
    	public Snake snake;
     
    	public int score;
     
    	public boolean gameOver;
     
            public boolean isOver;   
        private Graphics2D g;
     
     
            @SuppressWarnings("LeakingThisInConstructor")
    	public Engine(Canvas canvas) {
     
                    this.canvas = canvas;
            	this.board = new GameBoard();
    		this.snake = new Snake(board);
     
    		resetGame();
     
    		canvas.addKeyListener(this);
     
                    //new Engine(canvas).startGame();
    	}
     
     
     
    	public void startGame() {
    		canvas.createBufferStrategy(2);
                    canvas.setFocusable(true);
     
    		Graphics2D g = (Graphics2D)canvas.getBufferStrategy().getDrawGraphics();
    		g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
     
    		long start = 0L;
    		long sleepDuration = 0L;
    		while(true) {
    			start = System.currentTimeMillis();
     
    			update();
    			render(g);
     
    			canvas.getBufferStrategy().show();
     
    			g.clearRect(0, 0, canvas.getWidth(), canvas.getHeight());
     
    			sleepDuration = (1500L / UPDATES_PER_SECOND) - (System.currentTimeMillis() - start);
     
    			if(sleepDuration > 0) {
    				try {
    					Thread.sleep(sleepDuration);
    				} catch(Exception e) {
                                        e.printStackTrace();
    				}
    			}
    		}
    	}
     
    	public void update() {
    		if(gameOver || !canvas.isFocusable()) {
    			return;
    		}
                    canvas.setFocusable(true);
    		TileType snakeTile = snake.updateSnake();
    		if(snakeTile == null || snakeTile.equals(TileType.SNAKE)) {
    			gameOver = true;
    		} else if(snakeTile.equals(TileType.FRUIT)) {
    			score += 10;
    			spawnFruit();
    		}
    	}
     
    	public void render(Graphics2D g) {
    		board.draw(g);
     
    		g.setColor(Color.WHITE);
     
    		if(gameOver) {
    			g.setFont(FONT_LARGE);
    			String message = new String("Your Score: " + score);
    			g.drawString(message, canvas.getWidth() / 2 - (g.getFontMetrics().stringWidth(message) / 2), 250);
     
    			g.setFont(FONT_SMALL);
    			message = new String("Press Enter to Restart the Game");
    			g.drawString(message, canvas.getWidth() / 2 - (g.getFontMetrics().stringWidth(message) / 2), 350);
    		} else {
    			g.setFont(FONT_SMALL);
    			g.drawString("Score:" + score, 10, 20);
    		}
    	}
     
    	public void resetGame() {
    		board.resetBoard();
    		snake.resetSnake();
    		score = 0;
    		gameOver = false;
    		spawnFruit();
    	}
     
    	public void spawnFruit() {
    		int random = (int)(Math.random() * ((GameBoard.MAP_SIZE * GameBoard.MAP_SIZE) - snake.getSnakeLength())); // if '*' replace by '/' then only one fruit is there for snake
     
    		int emptyFound = 0;
    		int index = 0;
    		while(emptyFound < random) {
    			index++;
    			if(board.getTile(index % GameBoard.MAP_SIZE, index / GameBoard.MAP_SIZE).equals(TileType.EMPTY)) { // if '/' replaced by '*' then nothing displays on the board 
    				emptyFound++;
    			}
    		}
    		board.setTile(index % GameBoard.MAP_SIZE, index / GameBoard.MAP_SIZE, TileType.FRUIT); // it also show nothing when replacing '/' by '/' 
    	}
     
     
     
        public void keyPressed(KeyEvent e) {
    		if((e.getKeyCode()== KeyEvent.VK_UP)||(e.getKeyCode() == KeyEvent.VK_W)) {
    			snake.setDirection(Direction.UP);
    		}
    		if((e.getKeyCode() == KeyEvent.VK_DOWN)||(e.getKeyCode() == KeyEvent.VK_S)) {
    			snake.setDirection(Direction.DOWN);
    		}
    		if((e.getKeyCode() == KeyEvent.VK_LEFT)||(e.getKeyCode() == KeyEvent.VK_A)) {
    			snake.setDirection(Direction.LEFT);
    		}
    		if((e.getKeyCode() == KeyEvent.VK_RIGHT)||(e.getKeyCode() == KeyEvent.VK_D)) {
    			snake.setDirection(Direction.RIGHT);
    		}
    		if(e.getKeyCode() == KeyEvent.VK_ENTER && gameOver) {
    			resetGame();
    		}
    	}
     
     
     
     
    	     public static void main(String[] args)  {
     
                    new PlayGame().setVisible(true);
     
    		JFrame frame = new JFrame("SnakeGame");
    		frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
    		frame.setResizable(false);
     
    		Canvas canvas = new Canvas();
    		canvas.setBackground(Color.black);
    		canvas.setPreferredSize(new Dimension(GameBoard.MAP_SIZE * GameBoard.TILE_SIZE, GameBoard.MAP_SIZE * GameBoard.TILE_SIZE));
     
    		frame.getContentPane().add(canvas);
    		frame.pack();
    		frame.setLocationRelativeTo(null);
    		frame.setVisible(true); 
     
    		new Engine(canvas).startGame();
     
     
                 }        
    }

  10. #10
    Junior Member
    Join Date
    Sep 2013
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: how can i set an object in focus

    project is attached within this comment
    plz check it
    Attached Files Attached Files

  11. #11
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    18,574
    Thanks
    45
    Thanked 1,954 Times in 1,928 Posts

    Default Re: how can i set an object in focus

    You need to make ONE small complete program that compiles, executes and shows the problem. Don't post the code for the whole project. See: Short, Self Contained, Correct Example
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Replies: 1
    Last Post: June 20th, 2013, 01:45 PM
  2. KeyListeners: Automatic Focus?
    By bgroenks96 in forum Java Theory & Questions
    Replies: 32
    Last Post: June 24th, 2011, 09:03 PM
  3. [SOLVED] ArrayList object's elements confusing??? doesnt replace the elements? set() method?
    By chronoz13 in forum What's Wrong With My Code?
    Replies: 10
    Last Post: June 21st, 2011, 01:20 PM
  4. Set headers for HttpServletRequest object?
    By FailMouse in forum Web Frameworks
    Replies: 3
    Last Post: December 1st, 2010, 02:00 PM
  5. How do you set an object in array to null value?
    By Arius in forum What's Wrong With My Code?
    Replies: 5
    Last Post: January 25th, 2010, 02:50 AM

Tags for this Thread