I have an existing Java Swing
application. In the middle of the application is a single JPanel
which I want to be able to zoom in and out
of. The JPanel
has a number of JComponents
on it (mostly other JPanels
and JLabels
).
Also mouse
position will need to be adjusted appropriately as well - so mouseevents
need to remain same even after the JPanel
has been zoomed. As such simply changing the paint
methods of each component
doesn't seem plausible.
EDIT:
OK i kind of got it working using the MagnifierUI
class
with some minor edits. However the magnified panel I create has the wrong mouseevents
- i.e. the panel is scaled, mouseevents
are not.