I am having some issues the the implementation of the JScrollPane in my gui. I was wondering if anybody had any ideas?
For my GUI i the following
JFrame
>JPanel (nav bar)
>JPanel (gridlayout dynamic based on house size)
>> JPanel(each grid/cell)
>>> Componts (label etc)
>> JPanel (Stat bar)
This works fine to select and work with my rooms(part of the project) in each grid. I have the listener attached to the gridlayout panel, so i know where my mouse has clicked and therefore which grid it belongs to. The listener is the mouselistener on the JPanel.
But when i place a JScrollPane in here;
JFrame
>JPanel (nav bar)
>JPanel (gridlayout dynamic based on house size)
>>jScrollPane
>>>JPanel(each grid/cell)
>>>>Components (label etc)
>>>JPanel (Stat bar)
To give me the scroll bars for each room, my gui no longer accepts the mouse event (it does but not on the gridlayout JPanel as it did before). Does anybody know how i can overide the JScrollPane and let my JPanel underneath receive the event?
I am struggle to find a way to do this that will adhere to the MVC structure. As the code to check and prepare everything is in the controller which just hands the basic info over to the view to repaint it all.
Or i am just completely going in the wrong direction