Results 1 to 7 of 7
- 10-11-2012, 02:42 AM #1
Java Apprentice
- Join Date
- Oct 2012
- Location
- On my computer
- Posts
- 10
- Rep Power
- 0
java.awt.geom, Making Objects Invisible?
I'm attempting to place a rectangle over a part of a picture, but later I want it to disappear without affecting the things below it. Is this possible? I'm using java.awt.geom to place the rectangle over my other shapes. Here is the code I'm using to place the rectangle:
Also, what do I put around my code to get it to show up as code. Thanks for any help! :DJava Code:JFrame frame = new JFrame(); //Basic JFrame initialization here ProjectComponent project = new ProjectComponent(); frame.add(project); //ProjectComponent class that extends JComponent Graphics2D g2 = (Graphics2D) g; g2.setColor(Color.BLACK); Rectangle2D.Double pixel = new Rectangle2D.Double(xLoc, yLoc, 20, 20); g2.draw(pixel); g2.fill(pixel);
Last edited by Jakeob; 10-11-2012 at 03:32 AM. Reason: To add more detail
-
Re: java.awt.geom, Making Objects Invisible?
You may wish to supply more detail -- what graphics and GUI library are you using? Swing? AWT? SWT? Android? How are you currently doing your coding and animation? Can you show code? We're notoriously poor at guessing these sorts of things.
- 10-11-2012, 02:50 AM #3
Java Apprentice
- Join Date
- Oct 2012
- Location
- On my computer
- Posts
- 10
- Rep Power
- 0
Re: java.awt.geom, Making Objects Invisible?
I put java.awt.java in the title, but forgot to post it in the body of my post. I'll edit it in now.
-
Re: java.awt.geom, Making Objects Invisible?
To show code, you'd place [code] [/code] tags around your code. Note that the top tag, [code], is different than the bottom tag, [/code].
Not sure about others, but I still need to see more and know more about your program.
- 10-11-2012, 03:33 AM #5
Java Apprentice
- Join Date
- Oct 2012
- Location
- On my computer
- Posts
- 10
- Rep Power
- 0
Re: java.awt.geom, Making Objects Invisible?
Is that enough info?
What isn't understandable?
- 10-11-2012, 11:43 PM #6
Java Apprentice
- Join Date
- Oct 2012
- Location
- On my computer
- Posts
- 10
- Rep Power
- 0
Re: java.awt.geom, Making Objects Invisible?
bump :/
-
Re: java.awt.geom, Making Objects Invisible?
Again, you might get more takers if you give out more info. Consider creating and posting an SSCCE for instance.
Similar Threads
-
Making an invisible JButton that appears under the mouse pointer
By kjkrum in forum AWT / SwingReplies: 8Last Post: 04-04-2012, 01:45 AM -
Making two picture objects into one.
By Poles_Apart in forum New To JavaReplies: 5Last Post: 01-29-2012, 09:08 PM -
Making a pointer to objects
By Bongeh in forum New To JavaReplies: 9Last Post: 04-01-2010, 04:18 PM -
an API can return objects without making their classes public
By parthu_lkp in forum Advanced JavaReplies: 1Last Post: 08-11-2009, 02:00 PM -
Nodes and edges..making visible and invisible based on distance
By sfaiz in forum Java AppletsReplies: 2Last Post: 04-14-2009, 10:01 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks