Search:

Type: Posts; User: Att1li

Search: Search took 0.09 seconds.

  1. Replies
    21
    Views
    1,560

    Re: Mouselistener issues

    Thanks for your answer Greg.

    Yeah there are alot of crappy tutorials out there . I've looked through many of them . I already have my basic board layout which I can interact with using a mouse...
  2. Replies
    21
    Views
    1,560

    Re: Mouselistener issues

    I just did my graphics in accordance to some chess tutorial on youtube. Granted he doesn't sound like he entirely knows what he is talking about but it works , sortoff and I can't find a better...
  3. Replies
    21
    Views
    1,560

    Re: Mouselistener issues

    You are probably right ,
    My point is not to make this engine in an object-oriented fashion . It's just that I read that the graphics have to be in one class and the engine in another so I need to...
  4. Replies
    21
    Views
    1,560

    Re: Mouselistener issues

    I apologize for the confusion.

    What I wanted to do is access a few variables and methods from my UserInterface class.
    It was giving me an error because I was trying to access them through an...
  5. Replies
    21
    Views
    1,560

    Re: Mouselistener issues

    My mistake .
    When I said "it's not working" I meant that it shows me a red error on the code line in the IDE . Says 'symbol not found'
  6. Replies
    21
    Views
    1,560

    Re: Mouselistener issues

    So the


    f.add(ui); // Adds instance of the user interface class
    f.setSize(800,800); // Size of main window
    f.setVisible(true); // Has to be set true to be visible


    should be moved to the...
  7. Replies
    21
    Views
    1,560

    Re: Mouselistener issues

    In the constructor of the Userinterface class?
    I have it defined like this :


    public static void main(String[] args) {

    JFrame f = new JFrame("Chess graphix");
    ...
  8. Replies
    21
    Views
    1,560

    Re: Mouselistener issues

    I see ,
    So they way I understand it is that the add listener methods add a listener every time they are called so I should remove them from the paintComponent() method?
    Where should I put them...
  9. Replies
    21
    Views
    1,560

    Re: Mouselistener issues

    I'm not sure what you mean by addlistener method . I'm still a beginner in java so I apologise for the ignorance .
    Below is the whole class , so perhaps you can point as to where it's being called...
  10. Replies
    21
    Views
    1,560

    Re: Mouselistener issues

    Thanks for the reply .

    No it is written once each.
    I also have declared the following statements:



    @Override
    public void mouseClicked(MouseEvent e){
  11. Replies
    21
    Views
    1,560

    Mouselistener issues

    Hello

    I am making a Chess engine for a school project and i've been having some issues with the mouselistener .
    When I perform a mouse "pressed" event , the code inside the event gets executed 3...
Results 1 to 11 of 11