Ah realised it was to do with mixing Light and heavy components (I assume canvas is a heavyweight component).
Is there an equivalent swing component (have checked don't think there is). If not how do I get round problems of showing a canvas inside a panel which is inside a JTabbedPane...
I have a JFrame containing a JTabbedPane with 2 tabs and a JMenubar with a few menus and menu items. When I click on the menus when tab1 is highlighted everything behaves how it should in the ordering, but when I click on tab2 (which has a painted canvas on it) I find the menu is hidden behind...
Thanks prosper,
The real problem I have is how to determine when I click on a shape that is the one I want to move. For example I have 4 rectangles on the screen I click on one and drag only that one to a new location. I suppose I need to define the rectangle shape as the mouse listening area...
Hi,
I currently paint shapes to a canvas from an array and want to be able to move these shapes around the screen. Unfortunately I am unsure how to set up the MouseDragged event so that it redraws only the shape I want (Currently there is no link in the paint method to the mouseDragged...
Hi,
I am trying draw a number of shapes that are stored in an array, currently the program is not drawing at all. I have a basic understanding of how the paint method works and how to draw shapes that are hard coded am struggling shapes stored in a collection, is this the right way to do this...
I am writing a program to read in an SVG (Scalable Vector Graphics) XML application file and simply display the graphical output of the tags using the attributes within the tags. I have read in the file using a file reader and parsed it using a DOM (see Below), iterating through to obtain the...
Hi I am new to Java programming and am trying to read and an SVG (Scalable Vector Graphic) file from disk and output the elements and attributes e.g. <rect x="0" y="0" width="1280" height="1024"/> to a GUI.
I have figured out that I should use the DOM XML parser to load the file into a...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.