User Profile

Collapse

Profile Sidebar

Collapse
ragaman123
ragaman123
Last Activity: May 23 '07, 08:04 PM
Joined: Nov 12 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • ragaman123
    started a topic Mouse cursor over a JButton??
    in Java

    Mouse cursor over a JButton??

    Hi there,

    I have an 10 x 10 array of JButtons in my battleships project, which represent the sea. I was just wondering how do i find out which button the mouse cursor is over at any given time? I tried adding the following to the buttons:
    board.addMouseM otionListener(n ew MouseMovingHand ler());
    board.addMouseL istener(new MouseHandler()) ;
    ?

    Cheers,

    Ragaman
    See more | Go to post

  • ragaman123
    started a topic Mouse cursor over a JButton
    in Java

    Mouse cursor over a JButton

    Hello everyone,

    I have an 10 x 10 array of JButtons in my battleships project, which represent the sea. I was just wondering how do i find out which button the mouse is over at any given time? I need to know this as i am designing a way to place the ships at the start and it will show which where the ship will be placed when the mouse cursor is over any button. I add a mouse listener to the players board :
    board.addMouseM otionListener(n ew...
    See more | Go to post
    Last edited by JosAH; Apr 4 '07, 01:28 PM. Reason: added code tags for readability reasons

  • ragaman123
    replied to Repaint Manager
    in Java
    Thank you for the advice, how do i go about setting the original repaint manager?
    See more | Go to post

    Leave a comment:


  • ragaman123
    started a topic Repaint Manager
    in Java

    Repaint Manager

    Hello there,

    I am developing a game in java and for the options menu at the start i install a NullRepaintMana ger to override paint requests.
    I was wondering however how to later go back to not using this RepaintManger i.e disable this NullRepaintMang er and return to how repaint requests are normally handled?

    Any help or advice would be greatly appreciated,

    Cheers,

    Ragaman
    ...
    See more | Go to post

  • ragaman123
    replied to JOptionPane in full screen mode??
    in Java
    Thank you for your suggestion!I was using null and i noticed eclipse gave other options besides null, which specify the names of my JPanels and so fourth and specify where on the screen the message will be displayed.And it is displayed perfectly,

    Thank you,

    Ragaman
    See more | Go to post

    Leave a comment:


  • ragaman123
    started a topic JOptionPane in full screen mode??
    in Java

    JOptionPane in full screen mode??

    Hello there,

    I am designing a battleships game in java and am trying to output to the screen a simple message when a user sinks a ship. I have been trying to use JOptionPane to output a message, however it is not working correctly. The message is not being painted to the screen properly and the whole screen becomes inactive and i cant press any of the buttons on it. Any suggestions would be greatly appreciated??

    Cheers,...
    See more | Go to post

  • ragaman123
    replied to Battleships game
    in Java
    Thank you for your advise, i have tried using this however but still to no success.I think the problem is i have to get a reference to the button pressed in the actionPerformed method, and then use the setIcon and setVisible methods.However when i refer to a button in the actionPerformed method it is not the same button as in the main method.I will post the code for the sound player class, you also need the pictures and sounds, i will try put these...
    See more | Go to post

    Leave a comment:


  • ragaman123
    started a topic Battleships game
    in Java

    Battleships game

    Hello everyone,

    I am currently working on a battleships game and at the moment i am playing around with a interface which has various different buttons. The interface has a 2d grid of buttons and other buttons on it which make various noises when pressed.I am however having problems changeing the icon of any of the buttons. Iv put up all the code of it, i am sorry for putting the whole thing up but thought maybe if i left some out someone...
    See more | Go to post

  • ragaman123
    replied to Battleships game
    in Java
    Thanks again man, that site is quite useful.

    Cheers,

    Ragaman
    See more | Go to post

    Leave a comment:


  • ragaman123
    started a topic Battleships game
    in Java

    Battleships game

    Hello everyone,

    I am still working on my battleships project and have been doing some research into how i am going to implement it. I have been working with the idea of having a 2d grid of JButtons and have been looking into the graphics tutorials on the sun wesite but i have been advised that i would not need any of this (such as AlphaComposite) to display and change the display of the sea, ships etc. If so, does anyone have any ideas...
    See more | Go to post

  • ragaman123
    replied to Battleships game
    in Java
    Hello everyone,

    I am still working on my battleships project and have been doing some research into how i am going to implement it. I have been working with the idea of having a 2d grid of JButtons and have been looking into the graphics tutorials on the sun wesite but i have been advised that i would not need any of this (such as AlphaComposite) to display and change the display of the sea, ships etc. If so, does anyone have any ideas...
    See more | Go to post

    Leave a comment:


  • ragaman123
    replied to Battleships game
    in Java
    Thanks a million man, I appreciate it, i will give it a go.

    Regards,

    Ragaman
    See more | Go to post

    Leave a comment:


  • ragaman123
    started a topic Battleships game
    in Java

    Battleships game

    Hello there,

    I have currently started a project in java, a battleships game. I am having trouble deciding how to deploy the grid and have the pictures of ships hidden under each picture of blue square which represents the sea. Can anybody out there give me some helpful pointers? Much appreciated,
    thanks,
    Ragaman
    See more | Go to post
No activity results to display
Show More
Working...