Search:

Type: Posts; User: ufotje

Search: Search took 0.37 seconds.

  1. Replies
    17
    Views
    1,781

    [SOLVED] Re: Set Variable In Event Handler

    What did you expect? You create a new Data with the default constructor, which takes no parameters.
    So every instance variable Data has is still null.
    Of cource you need to set the value's first....
  2. Replies
    17
    Views
    1,781

    [SOLVED] Re: Set Variable In Event Handler

    Lol apperently not, otherwise he wouldn't have run in to that error...

    --- Update ---



    No offence, but if you have to ask something like this, I would start with following some basic java...
  3. Replies
    17
    Views
    1,781

    [SOLVED] Re: Set Variable In Event Handler

    Sorry my bad it should be:


    public MyMouseHandler(Data data){
    ...
    }
  4. Replies
    17
    Views
    1,781

    [SOLVED] Re: Set Variable In Event Handler

    class MyMouseHandler extends MouseAdapter {
    private Data dt;

    //Add Constructor
    class MyMouseHandler(Data data){
    dt = data;
    }

    //Add Getter
    public Data...
  5. Replies
    17
    Views
    1,781

    [SOLVED] Re: Set Variable In Event Handler

    He said classvariable so I automaticly asumed it was static, what's the point otherwise of creating a classvariable.
    If he uses your solution, I would declare a private instance variable and provide...
  6. Replies
    17
    Views
    1,781

    [SOLVED] Re: Set Variable In Event Handler

    Or don't make an instance at al and call the classvariable direct.
    YourClass.variable
Results 1 to 6 of 6